Skip to content
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 .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ You are a specialized assistant for developers working on Stretchly, a break-tim
- Respect the existing project structure
- Place new functionality in appropriate modules
- Follow the established patterns for event handling
- Do not write comments unless absolutely necessary; prefer self-explanatory code

## Testing Expectations
- Suggest tests for new functionality
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- do not check for Quiet Hours on Windows (deprecated)

### Fixed
- prevent error with negative time to break in tray icon
- hide close/minimize actions on Break window on macOS
- issue when not all strings correctly translate after language change

Expand Down
2 changes: 1 addition & 1 deletion app/utils/appIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AppIcon {
const invertedMonochromeString = this.inverted ? 'Inverted' : ''
const darkModeString = this.darkMode ? 'Dark' : ''
const timeToBreakInTrayString = (this.paused || this.reference === 'finishMicrobreak' ||
this.reference === 'finishBreak' || !this.timeToBreakInTray || !Number.isInteger(this.timeToBreak))
this.reference === 'finishBreak' || !this.timeToBreakInTray || !Number.isInteger(this.timeToBreak) || this.timeToBreak < 0)
Comment thread
hovancik marked this conversation as resolved.
? ''
: `Number${this.timeToBreak}`

Expand Down
15 changes: 15 additions & 0 deletions test/appIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,21 @@ describe('appIcon', function () {
appIcon.trayIconFileName.should.equal('trayNumber2.png')
})

it('does not add Number when timeToBreak is negative', function () {
const params = {
paused: false,
monochrome: false,
inverted: false,
darkMode: false,
platform: 'linux',
timeToBreakInTray: true,
timeToBreak: -1,
reference: 'startMicrobreak'
}
const appIcon = new AppIcon(params)
appIcon.trayIconFileName.should.equal('tray.png')
})

it('trayIconFileName works for light mode on Windows', function () {
const params = {
paused: false,
Expand Down
Loading