Refactor break handling to update state consistently#12
Open
Refactor break handling to update state consistently#12
Conversation
Deploying stretchly-for-web with
|
| Latest commit: |
14f305d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e09cf71d.stretchly-for-web.pages.dev |
| Branch Preview URL: | https://fix-time-ui.stretchly-for-web.pages.dev |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the break handling logic to ensure that related state updates occur together, reducing UI flicker during transitions.
- Refactored state updates in startLongBreak, startMiniBreak, finishMiniBreak, and finishLongBreak functions
- Improved consistency in updating timer, counter, left time, and formattedLeft assignment across break and work states
Comment on lines
+172
to
+173
| $: if (left) { | ||
| formattedLeft = formatTimeLeft(left) |
There was a problem hiding this comment.
The reactive block updating formattedLeft only executes when left is truthy, which means it will not update when left is 0. Consider revising the condition to ensure that the formatted time is updated appropriately in all relevant states or adding a comment to clarify that behavior where a left value of 0 should intentionally bypass formatting.
Suggested change
| $: if (left) { | |
| formattedLeft = formatTimeLeft(left) | |
| $: { | |
| formattedLeft = formatTimeLeft(left); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.