Skip to content

Commit 646fc06

Browse files
committed
group metadata name assignment to directly access state.accountTree.wallets
1 parent c43a1d3 commit 646fc06

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/account-tree-controller/src/AccountTreeController.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,8 @@ export class AccountTreeController extends BaseController<
420420

421421
// Apply persisted name if available (including empty strings)
422422
if (persistedGroupMetadata?.name !== undefined) {
423-
group.metadata.name = persistedGroupMetadata.name.value;
423+
state.accountTree.wallets[walletId].groups[groupId].metadata.name =
424+
persistedGroupMetadata.name.value;
424425
} else if (!group.metadata.name) {
425426
// Get the appropriate rule for this wallet type
426427
const rule = this.#getRuleForWallet(wallet);
@@ -433,7 +434,8 @@ export class AccountTreeController extends BaseController<
433434
const computedName = rule.getComputedAccountGroupName(typedGroup);
434435

435436
if (computedName) {
436-
group.metadata.name = computedName;
437+
state.accountTree.wallets[walletId].groups[groupId].metadata.name =
438+
computedName;
437439
} else {
438440
// Generate default name and ensure it's unique within the wallet
439441
let proposedName = '';
@@ -498,7 +500,8 @@ export class AccountTreeController extends BaseController<
498500
}
499501
} while (nameExists);
500502

501-
group.metadata.name = proposedName;
503+
state.accountTree.wallets[walletId].groups[groupId].metadata.name =
504+
proposedName;
502505

503506
// Persist the generated name to ensure consistency
504507
state.accountGroupsMetadata[group.id] ??= {};

0 commit comments

Comments
 (0)