Skip to content

fix(AccountList): auto-select first enabled account after load (#245)#248

Merged
lshw54 merged 1 commit intocodefrom
fix/issue-245-auto-select-first-account
Apr 26, 2026
Merged

fix(AccountList): auto-select first enabled account after load (#245)#248
lshw54 merged 1 commit intocodefrom
fix/issue-245-auto-select-first-account

Conversation

@lshw54
Copy link
Copy Markdown
Collaborator

@lshw54 lshw54 commented Apr 26, 2026

What

After login, the account list loaded but no row was selected — users had to manually click a row before Get OTP or Start Game would work. WPF defaults SelectedIndex to 0 on redrawSAccountList, auto-selecting the first account.

Fix

After getServiceAccounts completes and the drag-order is applied, auto-select the first enabled (non-banned) account if nothing is already selected.

Tests

Updated 3 test files — assertions that expected selectedSid === null after mount now expect 'sid-1' (the first enabled account). The "no selection" guard tests explicitly clear selectedSid before asserting.

Closes #245

… WPF defaults SelectedIndex to 0 on redrawSAccountList. The SPA left selectedSid as null after load, requiring a manual click before Get OTP / Start Game would work. Now auto-selects the first enabled account after getServiceAccounts completes, matching WPF behaviour.
@lshw54 lshw54 self-assigned this Apr 26, 2026
@lshw54 lshw54 merged commit 7a822b5 into code Apr 26, 2026
2 checks passed
@lshw54 lshw54 deleted the fix/issue-245-auto-select-first-account branch April 26, 2026 04:53
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