Fix getting querystring

This commit is contained in:
kyleplo 2018-08-22 14:25:31 -04:00 committed by GitHub
parent 78b88443c0
commit 0b9ceb413f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,6 +39,8 @@ class Search extends React.Component {
this.state.loadMore = false; this.state.loadMore = false;
let mode = ''; let mode = '';
const query = window.location.search;
const q = query.lastIndexOf('q=');
const m = query.lastIndexOf('mode='); const m = query.lastIndexOf('mode=');
if (m !== -1) { if (m !== -1) {
mode = query.substring(m + 5, query.length).toLowerCase(); mode = query.substring(m + 5, query.length).toLowerCase();