Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better break window loading #1442

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/break.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
})

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')
Expand Down Expand Up @@ -61,5 +60,6 @@
settings.get('language'))
}
}, 100)
ipcRenderer.send('long-break-loaded')

Check warning on line 63 in app/break.js

View check run for this annotation

Codecov / codecov/patch

app/break.js#L63

Added line #L63 was not covered by tests
})
}
18 changes: 12 additions & 6 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,11 @@
})
// microbreakWinLocal.webContents.openDevTools()
microbreakWinLocal.once('ready-to-show', () => {
log.info('Stretchly: ready-to-show fired')

Check warning on line 787 in app/main.js

View check run for this annotation

Codecov / codecov/patch

app/main.js#L787

Added line #L787 was not covered by tests
})

ipcMain.once('mini-break-loaded', () => {
log.info('Stretchly: Mini Break window loaded')

Check warning on line 791 in app/main.js

View check run for this annotation

Codecov / codecov/patch

app/main.js#L790-L791

Added lines #L790 - L791 were not covered by tests
if (showBreaksAsRegularWindows) {
microbreakWinLocal.show()
} else {
Expand All @@ -807,6 +812,7 @@
microbreakWinLocal.center()
}, 0)
}
updateTray()

Check warning on line 815 in app/main.js

View check run for this annotation

Codecov / codecov/patch

app/main.js#L815

Added line #L815 was not covered by tests
})

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

function startBreak () {
Expand Down Expand Up @@ -926,6 +929,11 @@
})
// breakWinLocal.webContents.openDevTools()
breakWinLocal.once('ready-to-show', () => {
log.info('Stretchly: ready-to-show fired')

Check warning on line 932 in app/main.js

View check run for this annotation

Codecov / codecov/patch

app/main.js#L932

Added line #L932 was not covered by tests
})

ipcMain.once('long-break-loaded', () => {
log.info('Stretchly: Long Break window loaded')

Check warning on line 936 in app/main.js

View check run for this annotation

Codecov / codecov/patch

app/main.js#L935-L936

Added lines #L935 - L936 were not covered by tests
if (showBreaksAsRegularWindows) {
breakWinLocal.show()
} else {
Expand All @@ -950,6 +958,7 @@
breakWinLocal.center()
}, 0)
}
updateTray()

Check warning on line 961 in app/main.js

View check run for this annotation

Codecov / codecov/patch

app/main.js#L961

Added line #L961 was not covered by tests
})

require('@electron/remote/main').enable(breakWinLocal.webContents)
Expand Down Expand Up @@ -982,9 +991,6 @@
app.dock.hide()
}
}
ipcMain.on('long-break-loaded', (event) => {
updateTray()
})
}

function breakComplete (shouldPlaySound, windows, breakType) {
Expand Down
2 changes: 1 addition & 1 deletion app/microbreak.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
})

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')
Expand Down Expand Up @@ -58,5 +57,6 @@
settings.get('language'))
}
}, 100)
ipcRenderer.send('mini-break-loaded')

Check warning on line 60 in app/microbreak.js

View check run for this annotation

Codecov / codecov/patch

app/microbreak.js#L60

Added line #L60 was not covered by tests
})
}
Loading