feat(plugin): add isActive property to AccountResponse in plugin API

This commit is contained in:
Paulhenry Saux
2026-08-14 13:26:08 +02:00
parent 6d0197fb24
commit 1e62029b6c
+4
View File
@@ -228,11 +228,14 @@ interface AccountResponse {
avatarColor: string;
isConnected: boolean;
isDefault: boolean;
isActive: boolean;
}
function doUserGetAccounts(): AccountResponse[] {
const state = useAccountStore.getState();
const activeAccountId = state.activeAccountId;
// we remove sensitive fields from the account entries before returning to the plugin
// we add a new field isActive to indicate which account is currently active
const accounts = state.accounts.map((account) => ({
id: account.id,
label: account.label,
@@ -243,6 +246,7 @@ function doUserGetAccounts(): AccountResponse[] {
avatarColor: account.avatarColor,
isConnected: account.isConnected,
isDefault: account.isDefault,
isActive: account.id === activeAccountId,
}));
return accounts;