Fix shortcut to currently open deck in reviewer #17797
Open
+39
−7
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.
Fixes #17772
Add functionality to maintain the current card and state when reopening the app through a shortcut.
IntentHandler.kt
to check if the reviewer is already open and if the current deck matches the deck in the shortcut. If the reviewer is open and the deck matches, bring the app to the foreground without changing the current card. If the reviewer is not open or the deck does not match, proceed with the existing logic to open the deck.Reviewer.kt
to add methods to save and restore the current card and state when the app is minimized and reopened through a shortcut. Call these methods in theonPause
andonResume
methods.ReviewerUi.kt
to add methods to save and restore the current card and state.