Skip to content

Commit 4e0fa67

Browse files
committed
fix: fix frozen accounts array
1 parent df6b21f commit 4e0fa67

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

wallets/react/src/hub/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ export function checkHubStateAndTriggerEvents(
125125
hasNetworkChanged = true;
126126
}
127127

128+
// TODO: `accounts` has been frozen, we should check and find where object.freeze() is calling.
129+
128130
// Check for accounts
129131
if (
130-
previousNamespaceState.accounts?.sort().toString() !==
131-
currentNamespaceState.accounts?.sort().toString()
132+
previousNamespaceState.accounts?.slice().sort().toString() !==
133+
currentNamespaceState.accounts?.slice().sort().toString()
132134
) {
133135
if (currentNamespaceState.accounts) {
134136
const formattedAddresses = currentNamespaceState.accounts.map(

0 commit comments

Comments
 (0)