add splash screen on load

This commit is contained in:
riqo 2021-02-28 14:27:51 -06:00
commit 346bfcba01
9 changed files with 218 additions and 243 deletions

View file

@ -30,10 +30,11 @@ let win: BrowserWindow | null;
const windowMount = (): void => {
backgroundMitt.emit('window-active', true);
ipcMain.removeAllListeners('update-recorder');
ipcMain.on('update-recorder', updateRecorder);
// handle renderer auth-token event
ipcMain.removeHandler('nav-bar'); // avoid setting duplicate handlers
ipcMain.handle('nav-bar', navBarHandler);
// handle renderer auth-token event
ipcMain.removeHandler('nav-bar'); // avoid setting duplicate handlers
ipcMain.handle('nav-bar', navBarHandler);
}
const windowDismount = (): void => {
@ -58,6 +59,7 @@ export const createWindow = async (options: WindowSettings): Promise<void> => {
width: options.width,
height: options.height,
resizable: options.resizable,
backgroundColor: '#EBEBEB',
frame: false,
minWidth: 350,
minHeight: 500,
@ -82,8 +84,12 @@ export const createWindow = async (options: WindowSettings): Promise<void> => {
// Handle window close.
win.on("closed", windowDismount);
win.once('ready-to-show', () => {
if (win) win.show()
})
win.webContents.on('did-finish-load', () => {
windowMount();
windowMount();
resolve();
});