Skip to content

Commit

Permalink
fix: Reload address page state when address changes (#1286)
Browse files Browse the repository at this point in the history
Co-authored-by: Bran <[email protected]>
  • Loading branch information
msarcev and brancoder authored Mar 12, 2024
1 parent ff4edb5 commit 6d9c4e1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/src/helpers/nova/hooks/useAccountAddressState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const useAccountAddressState = (address: AccountAddress): [IAccountAddres
...initialState,
addressDetails,
});
}, []);
}, [address.accountId]);

useEffect(() => {
let updatedState: Partial<IAccountAddressState> = {
Expand Down
2 changes: 1 addition & 1 deletion client/src/helpers/nova/hooks/useAnchorAddressState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const useAnchorAddressState = (address: AnchorAddress): [IAnchorAddressSt
...initialState,
addressDetails,
});
}, []);
}, [address.anchorId]);

useEffect(() => {
setState({
Expand Down
3 changes: 2 additions & 1 deletion client/src/helpers/nova/hooks/useEd25519AddressState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ export const useEd25519AddressState = (address: Ed25519Address): [IEd25519Addres
: { addressDetails: AddressHelper.buildAddress(bech32Hrp, address) };

setState({
...initialState,
addressDetails,
});
}, []);
}, [address.pubKeyHash]);

useEffect(() => {
setState({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const useImplicitAccountCreationAddressState = (
...initialState,
addressDetails,
});
}, []);
}, [address.address().pubKeyHash]);

useEffect(() => {
setState({
Expand Down
2 changes: 1 addition & 1 deletion client/src/helpers/nova/hooks/useNftAddressState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const useNftAddressState = (address: NftAddress): [INftAddressState, Reac
...initialState,
addressDetails,
});
}, []);
}, [address.nftId]);

useEffect(() => {
setState({
Expand Down

0 comments on commit 6d9c4e1

Please sign in to comment.