Skip to content

Commit

Permalink
Fix files not loaded on initial entrance in firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
netalondon committed Sep 8, 2024
1 parent ccbaf42 commit a008cc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions components/src/stores/base.context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ export function useBaseContext(): BaseContext {

useEffect(() => {
if (root) return;
attemptLoadAdapterFromIndexedDb().then((adapter) => {
if (!adapter) return;
setLocalFs(adapter);
});

if ("showDirectoryPicker" in window) {
attemptLoadAdapterFromIndexedDb().then((adapter) => {
if (!adapter) return;
setLocalFs(adapter);
});
}
}, [root, setLocalFs]);

const canUpgradeFs = `showDirectoryPicker` in window;
Expand Down
2 changes: 1 addition & 1 deletion web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function App() {

useEffect(() => {
if (baseContext.localFsRoot) return;
fs.stat("/projects/01/Not/Not.hdl").catch(async () => {
fs.stat("/projects/01/Not.hdl").catch(async () => {
await loaders.resetFiles(fs);
});
updateVersion(fs);
Expand Down

0 comments on commit a008cc2

Please sign in to comment.