aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2023-01-23 20:41:46 -0600
committerGitHub <noreply@github.com>2023-01-23 20:41:46 -0600
commitb55d705f13da8c2c6c47d098a027c3bae74ae3f7 (patch)
tree8046a9b1b213e6bb105070fdb3f38472f56eef60
parent98af1451bf1a4bbb39b03bd5171fd931b1d9b3f1 (diff)
parent1ef221f3935d0e03c6f2d7a78ba31b9fe3e92604 (diff)
downloadslskd-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.js5
-rw-r--r--src/web/src/components/Search/Searches.js2
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(() => {