fix: disabled accounts still being used in sticky selection

getCurrentAccountForFamily() returned accounts by index without checking
the enabled flag, causing disabled accounts to be selected in sticky mode.

The fix adds an enabled check before returning the account, ensuring
disabled accounts fall through to getNextForFamily() which properly
filters by enabled status.

Fixes #381
This commit is contained in:
Noe
2026-02-06 16:30:19 +00:00
parent 80b3ffe99c
commit ddcee09909

View File

@@ -466,7 +466,11 @@ export class AccountManager {
getCurrentAccountForFamily(family: ModelFamily): ManagedAccount | null {
const currentIndex = this.currentAccountIndexByFamily[family];
if (currentIndex >= 0 && currentIndex < this.accounts.length) {
return this.accounts[currentIndex] ?? null;
const account = this.accounts[currentIndex] ?? null;
// Only return account if it's enabled - disabled accounts should not be selected
if (account && account.enabled !== false) {
return account;
}
}
return null;
}