Skip to content

Commit

Permalink
fix: in extremely rare cases, PhStore may not exist when starting req…
Browse files Browse the repository at this point in the history
…uire load
  • Loading branch information
abose committed Jan 6, 2024
1 parent eb3e35c commit a954bbd
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,22 @@
function _requireDone() {
loadJS('verify-dependencies-loaded.js', null, document.body);
}
PhStore.storageReadyPromise
.finally(()=>{
loadJS('thirdparty/requirejs/require.js', _requireDone, document.body, "main");
});
if(window.PhStore){
window.PhStore.storageReadyPromise
.finally(()=>{
loadJS('thirdparty/requirejs/require.js', _requireDone, document.body, "main");
});
} else {
const interval = setInterval(()=>{
if(PhStore){
clearInterval(interval);
PhStore.storageReadyPromise
.finally(()=>{
loadJS('thirdparty/requirejs/require.js', _requireDone, document.body, "main");
});
}
}, 50);
}
}
</script>

Expand Down

0 comments on commit a954bbd

Please sign in to comment.