fix: Some spots where navigation state was not preserved

fix: Collection in main nav pops open when moving from starred collection
This commit is contained in:
Tom Moor
2022-04-04 19:04:28 -07:00
parent 26b5fa82e3
commit 20a69b711a
5 changed files with 11 additions and 21 deletions

View File

@@ -55,15 +55,17 @@ function CollectionScene() {
const canonicalUrl = updateCollectionUrl(match.url, collection);
if (match.url !== canonicalUrl) {
history.replace(canonicalUrl);
history.replace(canonicalUrl, history.location.state);
}
}
}, [collection, collection?.name, history, id, match.url]);
React.useEffect(() => {
if (collection) {
ui.setActiveCollection(collection);
ui.setActiveCollection(collection.id);
}
return () => ui.setActiveCollection(undefined);
}, [ui, collection]);
React.useEffect(() => {