Skip to content

Commit ea23307

Browse files
committed
feat: show account usage toast during multi-account rotation (email + position)
1 parent cf4203d commit ea23307

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/plugin.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,16 @@ export const createKimicodePlugin = (providerId: string) => async (
836836
lastAccountIndex = account.index;
837837
}
838838

839+
// Show toast when switching accounts (debounced).
840+
const accountCount = accountManager.getAccountCount();
841+
if (accountCount > 1 && accountManager.shouldShowAccountToast(account.index)) {
842+
const accountLabel = account.email || `Account ${account.index + 1}`;
843+
const enabledAccounts = accountManager.getEnabledAccounts();
844+
const enabledPosition = enabledAccounts.findIndex(a => a.index === account.index) + 1;
845+
await showToast(`Using ${accountLabel} (${enabledPosition}/${accountCount})`, "info");
846+
accountManager.markToastShown(account.index);
847+
}
848+
839849
// Resolve/refresh the account's access token.
840850
let accountAuth = resolveCachedAuth(accountManager.toAuthDetails(account));
841851
if (accessTokenExpired(accountAuth)) {

0 commit comments

Comments
 (0)