lortza / lortza/therapy_tracker

stop all running timers in modal if "close" button is clicked

Open
#34 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

javascript
Dominant language
Ruby
Stars
9
Forks
3
Avg merge
24m
Merged PRs (30d)
11

Description

## Current Behavior
When a user is using the timer feature, there is an option to dismiss the modal. If a timer is still running (and beeping), and the user dismisses the modal, the javascript for the timer will keep running. The user has to refresh the show page or re-open the modal and click "Stop" to make the timer stop. FYI, the "Stop" button simply refreshes the show page.

## Preferred Behavior
If the user clicks "Stop" or if the user dismisses the modal, I'd like the timer to stop beeping and reset itself.

This may help: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearTimeout

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the timer feature's JavaScript and the modal's close and Stop button handlers. Start by tracing where the timer is created and how the show page refresh currently stops it, then use the referenced clearTimeout documentation. Done means both Stop and modal dismissal stop the beeping timer and reset its state without requiring a refresh or reopening the modal.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, ruby
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.