Skip to content

London | 26 ITP January | Mouawia Elkhalifa | Sprint 3 | Alarm Clock#1087

Open
MouawiaElkhalifa wants to merge 2 commits intoCodeYourFuture:mainfrom
MouawiaElkhalifa:sprint-3
Open

London | 26 ITP January | Mouawia Elkhalifa | Sprint 3 | Alarm Clock#1087
MouawiaElkhalifa wants to merge 2 commits intoCodeYourFuture:mainfrom
MouawiaElkhalifa:sprint-3

Conversation

@MouawiaElkhalifa
Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

In this PR, I have completed the Alarm Clock assignment for Sprint 3.

@MouawiaElkhalifa MouawiaElkhalifa added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 24, 2026
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Code works fine if a user only clicks the "Set Alarm" button once.
    However, if the user enters a time and then clicks the "Set Alarm" button multiple times, the countdown clock will not display properly.
    Can you fix the issue?

  • You missed updating index.html according to an instruction in readme.md.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 5, 2026
@MouawiaElkhalifa MouawiaElkhalifa added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 5, 2026
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(1) Currently when starting a new countdown, the application does not always return to a clean initial state, which can lead to inconsistent behavior between runs. (Hint: a user may not click the "Stop" button first before starting a new count down.)

You can consider introducing a dedicated reset function to return the app to a clean initial state to help ensure consistency.

(2) Can you make the "Stop" button to also stop the count down? You can add another "click" event listener to the button to avoid modifying the original code.

const timeDisplay = document.getElementById("timeRemaining");

if (isNaN(secondsLeft) || secondsLeft <= 0) {
timeDisplay.innerText = "Time Remaining: 00:00";
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could consider calling updateDisplay(0) on line 8, trading few milliseconds for simpler code, and keep the logic of displaying time in one place.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants