Skip to content

Commit e547df6

Browse files
chore: reload transactions after chain change
1 parent 709c059 commit e547df6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/appkit/src/AppKit.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,6 @@ export class AppKit {
613613
const connection = ConnectionsController.state.connections.get(namespace);
614614
const isAuth = !!connection?.properties?.provider;
615615

616-
const activeAddress = ConnectionsController.state.activeAddress;
617616
const activeNamespace = ConnectionsController.state.activeNamespace;
618617

619618
const network = this.networks.find(n => n.id?.toString() === chainId);
@@ -626,8 +625,13 @@ export class AppKit {
626625
}
627626

628627
// Refresh transactions only when the active network changes
629-
if (namespace === activeNamespace && activeAddress) {
630-
TransactionsController.fetchTransactions(activeAddress, true);
628+
if (namespace === activeNamespace) {
629+
const address = connection?.accounts?.find(account =>
630+
account.startsWith(`${namespace}:${chainId}`)
631+
);
632+
if (address) {
633+
TransactionsController.fetchTransactions(address, true);
634+
}
631635
}
632636

633637
// Check if user needs to sign in again

0 commit comments

Comments
 (0)