Fix some SWR funkiness
This commit is contained in:
parent
5da9824fb7
commit
fa9800fa88
4 changed files with 30 additions and 22 deletions
|
@ -28,6 +28,10 @@ export default () => {
|
|||
const setDirectory = ServerContext.useStoreActions(actions => actions.files.setDirectory);
|
||||
|
||||
useEffect(() => {
|
||||
// We won't automatically mutate the store when the component re-mounts, otherwise because of
|
||||
// my (horrible) programming this fires off way more than we intend it to.
|
||||
mutate();
|
||||
|
||||
setDirectory(hash.length > 0 ? hash : '/');
|
||||
}, [ hash ]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue