diff options
| author | JP Dillingham <jp@dillingham.me> | 2023-01-23 20:41:46 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-23 20:41:46 -0600 |
| commit | b55d705f13da8c2c6c47d098a027c3bae74ae3f7 (patch) | |
| tree | 8046a9b1b213e6bb105070fdb3f38472f56eef60 | |
| parent | 98af1451bf1a4bbb39b03bd5171fd931b1d9b3f1 (diff) | |
| parent | 1ef221f3935d0e03c6f2d7a78ba31b9fe3e92604 (diff) | |
| download | slskd-b55d705f13da8c2c6c47d098a027c3bae74ae3f7.tar.gz | |
Merge pull request #857 from mattgoldspink/feature/fix-reload-to-stay-on-current-search
Fix browser reload to stay on the same page
| -rw-r--r-- | src/web/src/components/App.js | 5 | ||||
| -rw-r--r-- | src/web/src/components/Search/Searches.js | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index 70d154af..74ae2cd8 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -356,7 +356,10 @@ class App extends Component { <System {...props} state={applicationState} options={applicationOptions} /> ) }/> - <Redirect from='*' to={`${urlBase}/searches`}/> + <Route render={(props) => + /\/(searches\/?|browse|users|chat|rooms|uploads|downloads|system\/)/ + .test(props.location.pathname) ? + <></> : <Redirect to={`${urlBase}/searches`}/>} /> </>} </Switch> </AppContext.Provider> diff --git a/src/web/src/components/Search/Searches.js b/src/web/src/components/Search/Searches.js index 46a9f709..42b82f8c 100644 --- a/src/web/src/components/Search/Searches.js +++ b/src/web/src/components/Search/Searches.js @@ -42,8 +42,8 @@ const Searches = ({ server }) => { const onConnectionError = (error) => { setConnecting(false); setError(error); }; const onUpdate = (update) => { - onConnected(); setSearches(update); + onConnected(); }; useEffect(() => { |
