Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hovancik committed Feb 16, 2024
1 parent 00a8000 commit 136913c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -807,6 +812,7 @@ function startMicrobreak () {
microbreakWinLocal.center()
}, 0)
}
updateTray()
})

require('@electron/remote/main').enable(microbreakWinLocal.webContents)
Expand Down Expand Up @@ -839,9 +845,6 @@ function startMicrobreak () {
app.dock.hide()
}
}
ipcMain.on('mini-break-loaded', (event) => {
updateTray()
})
}

function startBreak () {
Expand Down
4 changes: 3 additions & 1 deletion app/microbreak.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const Store = require('electron-store')
const settings = new Store()

window.onload = (e) => {
__electronLog.info('onload')
ipcRenderer.send('send-microbreak-data')
require('./platform')
new HtmlTranslate(document).translate()
Expand All @@ -28,7 +29,7 @@ window.onload = (e) => {
})

ipcRenderer.once('progress', (event, started, duration, strictMode, postpone, postponePercent, backgroundColor) => {
ipcRenderer.send('mini-break-loaded')
__electronLog.info('progress')
const progress = document.querySelector('#progress')
const progressTime = document.querySelector('#progress-time')
const postponeElement = document.querySelector('#postpone')
Expand Down Expand Up @@ -58,5 +59,6 @@ window.onload = (e) => {
settings.get('language'))
}
}, 100)
ipcRenderer.send('mini-break-loaded')
})
}

0 comments on commit 136913c

Please sign in to comment.