Skip to content

Commit

Permalink
fix(loading): safely check descriptions and remove race condition on …
Browse files Browse the repository at this point in the history
…balances in wallet state
  • Loading branch information
atticusofsparta committed Dec 17, 2024
1 parent c1ebc9a commit bee8385
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/components/forms/DomainSettings/DomainSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ function DomainSettings({
[DomainSettingsRowTypes.DESCRIPTION]: (
<DescriptionRow
key={DomainSettingsRowTypes.DESCRIPTION}
description={data?.info.Description}
description={data?.info?.Description}
editable={isAuthorized}
confirm={(description: string) =>
dispatchANTInteraction({
Expand All @@ -464,7 +464,7 @@ function DomainSettings({
[DomainSettingsRowTypes.KEYWORDS]: (
<KeywordsRow
key={DomainSettingsRowTypes.KEYWORDS}
keywords={data?.info.Keywords}
keywords={data?.info?.Keywords}
editable={isAuthorized}
confirm={(keywords: string[]) =>
dispatchANTInteraction({
Expand Down
10 changes: 0 additions & 10 deletions src/state/contexts/WalletState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,6 @@ export function WalletStateProvider({
return () => ARWEAVE_APP_API.off('disconnect', removeWalletState);
}, [walletAddress, wallet, aoClient]);

useEffect(() => {
if (!Object.keys(state.balances).includes(arioTicker)) {
const { ar, ...ioFee } = state.balances;
dispatchWalletState({
type: 'setBalances',
payload: { ar, [arioTicker]: Object.values(ioFee)[0] },
});
}
}, [arioTicker]);

useEffect(() => {
window.addEventListener('arweaveWalletLoaded', updateIfConnected);

Expand Down

0 comments on commit bee8385

Please sign in to comment.