From ddcee09909069cd5135aa693d96b5bf8d4e11529 Mon Sep 17 00:00:00 2001 From: Noe Date: Fri, 6 Feb 2026 16:30:19 +0000 Subject: [PATCH] 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 --- src/plugin/accounts.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugin/accounts.ts b/src/plugin/accounts.ts index bcdd07f..0dfaddf 100644 --- a/src/plugin/accounts.ts +++ b/src/plugin/accounts.ts @@ -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; }