fix(StandaloneRouter): Fix broken query string parsing in StandaloneRouter. Pass location object to

fix #731
This commit is contained in:
Erik Ziegler 2019-07-29 17:19:31 +02:00
parent 40bf1a2efd
commit 0e78836d55
2 changed files with 7 additions and 2 deletions

View File

@ -188,7 +188,7 @@ class OHIFStandaloneViewer extends Component {
this.setState({ isLoading: false });
}}
>
{match === null ? <></> : <Component match={match} />}
{match === null ? <></> : <Component match={match} location={this.props.location}/>}
</CSSTransition>
)}
</Route>

View File

@ -90,7 +90,12 @@ class StandaloneRouting extends Component {
async componentDidMount() {
try {
const query = qs.parse(this.props.location.search);
let { search } = this.props.location;
// Remove ? prefix which is included for some reason
search = search.slice(1, search.length);
const query = qs.parse(search);
const studies = await StandaloneRouting.parseQueryAndFetchStudies(query);
studyMetadataManager.purge();