Skip to content

Commit

Permalink
fix(frontend): rollback to Router to maintain queryParams sync with s…
Browse files Browse the repository at this point in the history
…tore
  • Loading branch information
eh-am committed Jan 3, 2022
1 parent 80899ff commit b7e8da6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 3 additions & 4 deletions webapp/javascript/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ReactDOM from 'react-dom';
import React from 'react';

import { Provider } from 'react-redux';
import { BrowserRouter, Switch, Route } from 'react-router-dom';
import { Router, BrowserRouter, Switch, Route } from 'react-router-dom';
import FPSStats from 'react-fps-stats';
import { isExperimentalAdhocUIEnabled } from '@utils/features';
import Notifications from '@ui/Notifications';
Expand All @@ -17,7 +17,6 @@ import AdhocComparison from './components/AdhocComparison';
import ServerNotifications from './components/ServerNotifications';

import history from './util/history';
import basename from './util/baseurl';

let showFps = false;
try {
Expand All @@ -30,7 +29,7 @@ try {

ReactDOM.render(
<Provider store={store}>
<BrowserRouter history={history} basename={basename()}>
<Router history={history}>
<ServerNotifications />
<Notifications />
<div className="app">
Expand All @@ -57,7 +56,7 @@ ReactDOM.render(
)}
</Switch>
</div>
</BrowserRouter>
</Router>
{showFps ? <FPSStats left="auto" top="auto" bottom={2} right={2} /> : ''}
</Provider>,
document.getElementById('root')
Expand Down
6 changes: 5 additions & 1 deletion webapp/javascript/util/history.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// src/myHistory.js
import { createBrowserHistory } from 'history';
const history = createBrowserHistory();
import basename from './baseurl';

const history = createBrowserHistory({
basename: basename(),
});
export default history;

0 comments on commit b7e8da6

Please sign in to comment.