Skip to content

Fix auto-run timer stopping unexpectedly#48

Open
ColetteDiskette wants to merge 2 commits into
StreamController:mainfrom
ColetteDiskette:patch-1
Open

Fix auto-run timer stopping unexpectedly#48
ColetteDiskette wants to merge 2 commits into
StreamController:mainfrom
ColetteDiskette:patch-1

Conversation

@ColetteDiskette

Copy link
Copy Markdown

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 not to or allows 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant