Skip to content

Commit

Permalink
fix screen flash on prompt creation
Browse files Browse the repository at this point in the history
show prompt window only when its content is ready to be shown
  • Loading branch information
Araxeus committed Apr 21, 2022
1 parent b7684a6 commit 2bab8be
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ function electronPrompt(options, parentWindow) {
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: options_.enableRemoteModule
}
},
show: false
});

if (options_.enableRemoteModule) {
Expand Down Expand Up @@ -168,6 +169,11 @@ function electronPrompt(options, parentWindow) {

//Finally, load prompt
promptWindow.loadURL(promptUrl);

// show window only when ready
promptWindow.once('ready-to-show', () => {
promptWindow.show();
});
});
}

Expand Down

0 comments on commit 2bab8be

Please sign in to comment.