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
10 changes: 9 additions & 1 deletion changelog.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
// Version tracking
export const APP_VERSION = '1.0.22';
export const APP_VERSION = '1.0.23';

export const CHANGELOG = {
'1.0.23': {
date: '2026-02-02',
changes: {
improvements: [
'Resolve issue with Reset Day showing incorrect timer value',
],
},
},
'1.0.22': {
date: '2026-02-02',
changes: {
Expand Down
28 changes: 28 additions & 0 deletions cypress/e2e/05-timer-behavior.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,32 @@ describe('Timer Behavior', () => {
// Verify timer shows full day countdown
cy.get('.timer-display').should('not.have.text', '00:00');
});

it('shows the correct timer value when Reset Day is used', () => {
cy.visit('/');

cy.get('#settingsDialog').should('be.visible');
cy.get('#closeSettings').click();
cy.get('#settingsDialog').should('not.be.visible');

// Click Day 1 preset to start the timer and capture its full duration
cy.get('#clocktowerPresets .clocktower-btn')
.first()
.then(($btn) => {
const expectedMinutes = String(
parseInt($btn.attr('data-minutes'), 10)
).padStart(2, '0');
const expectedSeconds = String(
parseInt($btn.attr('data-seconds'), 10)
).padStart(2, '0');

cy.get('#clocktowerPresets .clocktower-btn').first().click();
cy.wait(1000); // Let timer count down briefly
cy.get('#resetBtn').click();

// Timer should show the full day value (same as Day 1 preset)
cy.get('#minutes').should('have.text', expectedMinutes);
cy.get('#seconds').should('have.text', expectedSeconds);
});
});
});
10 changes: 7 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1573,9 +1573,13 @@ function resetTimer() {
wakeUpTimeout = null;
}

// Reset to the full day countdown time
const timerValues = calcTimerStartEndValues(playerCount);
timeLeft = timerValues.dayStartValue * 60; // Convert minutes to seconds
// Reset to the full day countdown time (use current day's preset, which includes pace)
const day = currentDay ?? 1;
const presets = generateDayPresets(playerCount);
const preset = presets.find((p) => p.day === day) ?? presets[0];
timeLeft = preset.minutes * 60 + preset.seconds;
selectedMinutes = preset.minutes;
selectedSeconds = preset.seconds;
currentInterval = normalInterval;
isRunning = false; // Ensure timer is marked as not running
hasReset = true; // Set the reset state
Expand Down