feat(otp): double-click-to-copy + per-account OTP cache (#300)#307
Merged
Conversation
…300) Two OTP UX regressions/requests vs WPF 5.9.2: 1. Regression — double-clicking the generated OTP used to auto-copy it; the rewrite left the dedicated copy icon as the only path. Restore the gesture: AccountList's OTP field now copies on dblclick (with a GetOtpSuccessAndCopy toast, since a double-click has no persistent affordance to confirm the copy landed). 2. Feature — switching between sub-accounts blanked the OTP field. Add a per-sid OTP cache so each account's last token is restored when the user toggles back, instead of resetting. Cache is session/list-scoped (cleared on game switch + logout); no time-based expiry by design — Start Game always routes through a fresh fetch, so a cached value is never auto-launched off.
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.
What
Fixes the two OTP items in #300 (regression + feature request vs WPF 5.9.2):
Fix
src/pages/AccountList.vue:@dblclickon the OTP field copies the current OTP via the existing clipboard helper, with aGetOtpSuccessAndCopytoast (the copy icon stays silent; a double-click has no persistent affordance, so explicit feedback is what confirms the copy).Map<sid, otp>records each account's last OTP; theselectedSidwatcher restores the cached value on row change instead of unconditionally blanking. Cleared on game switch and on logout. No time-based expiry by design — Start Game always routes through a fresh fetch, so a cached token is never auto-launched.Closes #300