Skip to content

Commit

Permalink
fix(ConnectWalletForm): correctly render error from transientState (#837
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sidvishnoi authored Jan 16, 2025
1 parent 6ebcedf commit 16c100e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pages/popup/components/ConnectWalletForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from '@/pages/shared/components/InputAmount';
import { toWalletAddressUrl } from '@/pages/shared/lib/utils';
import { useTranslation } from '@/popup/lib/context';
import { deepClone } from 'valtio/utils';
import {
cn,
errorWithKey,
Expand Down Expand Up @@ -104,8 +105,12 @@ export const ConnectWalletForm = ({
const [errors, setErrors] = React.useState<Errors>({
walletAddressUrl: null,
amount: null,
keyPair: state?.status === 'error:key' ? toErrorInfo(state.error) : null,
connect: state?.status === 'error' ? toErrorInfo(state.error) : null,
keyPair:
state?.status === 'error:key'
? toErrorInfo(deepClone(state.error))
: null,
connect:
state?.status === 'error' ? toErrorInfo(deepClone(state.error)) : null,
});
const [isValidating, setIsValidating] = React.useState({
walletAddressUrl: false,
Expand Down

0 comments on commit 16c100e

Please sign in to comment.