Skip to content

Commit

Permalink
fix: use longer timeout to ensure slash screen showup
Browse files Browse the repository at this point in the history
  • Loading branch information
linonetwo committed Sep 11, 2023
1 parent 73e3049 commit a7ea809
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ export const webviewSideReceiver = `// Initialize an empty string to start with
* We execute the script tags after this.
*/
const observer = new MutationObserver((mutationsList, observer) => {
let hasChange = false;
for (let mutation of mutationsList) {
if (mutation.type === 'childList') {
observer.disconnect(); // Important: disconnect the observer once done.
// use timeout to give splash screen a chance to execute and show
setTimeout(executeScriptsAfterInjectHTML, 1)
hasChange = true;
}
}
if (hasChange) {
observer.disconnect(); // Important: disconnect the observer once done.
// use timeout to give splash screen a chance to execute and show
setTimeout(executeScriptsAfterInjectHTML, 100);
}
});
// Start observing the body with the configured parameters
Expand Down

0 comments on commit a7ea809

Please sign in to comment.