diff --git a/CHANGELOG.md b/CHANGELOG.md index 823a2a54a..2d6cf9f08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Schedule and Menu options not being updated after change of language - multiple RTL UI issues - RPM installer conflicts with other Electron apps +- improve break window loading to fix blank window ## [1.15.1] - 2023-11-19 ### Fixed diff --git a/app/break.js b/app/break.js index c524770ee..9bec67997 100644 --- a/app/break.js +++ b/app/break.js @@ -30,7 +30,6 @@ window.onload = (event) => { }) ipcRenderer.once('progress', (event, started, duration, strictMode, postpone, postponePercent, backgroundColor) => { - ipcRenderer.send('long-break-loaded') const progress = document.querySelector('#progress') const progressTime = document.querySelector('#progress-time') const postponeElement = document.querySelector('#postpone') @@ -61,5 +60,6 @@ window.onload = (event) => { settings.get('language')) } }, 100) + ipcRenderer.send('long-break-loaded') }) } diff --git a/app/main.js b/app/main.js index e64c3a6c2..7b13c04dc 100644 --- a/app/main.js +++ b/app/main.js @@ -784,6 +784,11 @@ function startMicrobreak () { }) // microbreakWinLocal.webContents.openDevTools() microbreakWinLocal.once('ready-to-show', () => { + log.info('Stretchly: ready-to-show fired') + }) + + ipcMain.once('mini-break-loaded', () => { + log.info('Stretchly: Mini Break window loaded') if (showBreaksAsRegularWindows) { microbreakWinLocal.show() } else { @@ -807,6 +812,7 @@ function startMicrobreak () { microbreakWinLocal.center() }, 0) } + updateTray() }) require('@electron/remote/main').enable(microbreakWinLocal.webContents) @@ -839,9 +845,6 @@ function startMicrobreak () { app.dock.hide() } } - ipcMain.on('mini-break-loaded', (event) => { - updateTray() - }) } function startBreak () { @@ -926,6 +929,11 @@ function startBreak () { }) // breakWinLocal.webContents.openDevTools() breakWinLocal.once('ready-to-show', () => { + log.info('Stretchly: ready-to-show fired') + }) + + ipcMain.once('long-break-loaded', () => { + log.info('Stretchly: Long Break window loaded') if (showBreaksAsRegularWindows) { breakWinLocal.show() } else { @@ -950,6 +958,7 @@ function startBreak () { breakWinLocal.center() }, 0) } + updateTray() }) require('@electron/remote/main').enable(breakWinLocal.webContents) @@ -982,9 +991,6 @@ function startBreak () { app.dock.hide() } } - ipcMain.on('long-break-loaded', (event) => { - updateTray() - }) } function breakComplete (shouldPlaySound, windows, breakType) { diff --git a/app/microbreak.js b/app/microbreak.js index e50d6496a..d16788f92 100644 --- a/app/microbreak.js +++ b/app/microbreak.js @@ -28,7 +28,6 @@ window.onload = (e) => { }) ipcRenderer.once('progress', (event, started, duration, strictMode, postpone, postponePercent, backgroundColor) => { - ipcRenderer.send('mini-break-loaded') const progress = document.querySelector('#progress') const progressTime = document.querySelector('#progress-time') const postponeElement = document.querySelector('#postpone') @@ -58,5 +57,6 @@ window.onload = (e) => { settings.get('language')) } }, 100) + ipcRenderer.send('mini-break-loaded') }) }