mirror of
https://github.com/NoeFabris/opencode-antigravity-auth.git
synced 2026-05-13 23:53:18 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user