Fix some SWR funkiness

This commit is contained in:
Dane Everitt 2020-07-10 22:53:52 -07:00
parent 5da9824fb7
commit fa9800fa88
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 30 additions and 22 deletions

View file

@ -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 ]);