Skip to content

Commit

Permalink
Merge pull request #1489 from hovancik/fix-end-break
Browse files Browse the repository at this point in the history
Fix error when end break shortcut is not set
  • Loading branch information
hovancik authored Sep 25, 2024
2 parents c4db2d5 + 1613273 commit f9e08d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
- Bengali, Serbian and Greek translations
### Fixed
- error when end break shortcut is not set

## [1.16.0] - 2024-08-11
### Added
Expand Down
8 changes: 4 additions & 4 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ function startBreak () {
}

function breakComplete (shouldPlaySound, windows, breakType) {
if (globalShortcut.isRegistered(settings.get('endBreakShortcut'))) {
if (settings.get('endBreakShortcut') && globalShortcut.isRegistered(settings.get('endBreakShortcut'))) {
globalShortcut.unregister(settings.get('endBreakShortcut'))
}
if (shouldPlaySound && !settings.get('silentNotifications')) {
Expand Down Expand Up @@ -1211,7 +1211,7 @@ function getTrayMenuTemplate () {
}

if (breakPlanner.scheduler.reference === 'finishMicrobreak' && settings.get('microbreakStrictMode') &&
!settings.get('showBreakActionsInStrictMode')) {
!settings.get('showBreakActionsInStrictMode')) {
// nothing
} else if (breakPlanner.scheduler.reference === 'finishBreak' && settings.get('breakStrictMode') &&
!settings.get('showBreakActionsInStrictMode')) {
Expand Down Expand Up @@ -1250,7 +1250,7 @@ function getTrayMenuTemplate () {
!settings.get('showBreakActionsInStrictMode')) {
// nothing
} else if (breakPlanner.scheduler.reference === 'finishBreak' && settings.get('breakStrictMode') &&
!settings.get('showBreakActionsInStrictMode')) {
!settings.get('showBreakActionsInStrictMode')) {
// nothing
} else if (!(breakPlanner.dndManager.isOnDnd || breakPlanner.appExclusionsManager.isSchedulerCleared)) {
trayMenu.push({
Expand Down Expand Up @@ -1475,7 +1475,7 @@ ipcMain.on('set-contributor', function (event) {
const dir = app.getPath('userData')
const contributorStampFile = `${dir}/stamp`
const { DateTime } = require('luxon')
require('fs').writeFile(contributorStampFile, DateTime.now().toString(), () => {})
require('fs').writeFile(contributorStampFile, DateTime.now().toString(), () => { })
global.shared.isContributor = true
log.info('Stretchly: Logged in. Thanks for your contributions!')
if (preferencesWin) {
Expand Down

0 comments on commit f9e08d0

Please sign in to comment.