Fix auto-run timer stopping unexpectedly#48
Open
ColetteDiskette wants to merge 2 commits into
Open
Conversation
The timer is a one-shot timer and was previously only being reset when the deck was on the page the button was on *and* "Keep auto running in background" was disabled. Changing this `and not` to an `or` makes it so that it resets when on its page *or* "Keep auto running ..." is enabled.
Manually triggering the command with a button press would result in auto-run no longer triggering. Restarting the timer when the button is pressed prevents this.
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.
This PR fixes two issues with the "Run Command" action.
First, the timer was previously only being restarted when the action was present on the active page and "Keep auto running in background" was disabled. As a result, enabling "Keep auto running in background" caused the command to execute only once. Changing this condition from
and nottoorallows the timer to continue running when background execution is enabled.Second, manually executing the command would stop the active timer without restarting it, preventing any future automatic executions. Restarting the timer after a manual execution ensures that auto-run continues to function and that the interval is reset from the time of the button press.