Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit 4524946

Browse files
futurepaulAnthonyRonning
authored andcommitted
bump the timeout and make sure we're not done loading
1 parent 7d68c37 commit 4524946

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/state/megaStore.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,20 +204,23 @@ export const Provider: ParentComponent = (props) => {
204204
await setSettings(settings);
205205
}
206206

207-
// 60 seconds to load or we bail
207+
// 90 seconds to load or we bail
208208
const start = Date.now();
209-
const MAX_LOAD_TIME = 60000;
209+
const MAX_LOAD_TIME = 90000;
210210
const interval = setInterval(() => {
211211
console.log("Running setup", Date.now() - start);
212212
if (Date.now() - start > MAX_LOAD_TIME) {
213213
clearInterval(interval);
214-
// Have to set state error here because throwing doesn't work if WASM panics
215-
setState({
216-
setup_error: new Error(
217-
"Load timed out, please try again"
218-
)
219-
});
220-
return;
214+
// Only want to do this if we're really not done loading
215+
if (state.load_stage !== "done") {
216+
// Have to set state error here because throwing doesn't work if WASM panics
217+
setState({
218+
setup_error: new Error(
219+
"Load timed out, please try again"
220+
)
221+
});
222+
return;
223+
}
221224
}
222225
}, 1000);
223226

0 commit comments

Comments
 (0)