Skip to content

Commit

Permalink
Make wallet metadata update optional
Browse files Browse the repository at this point in the history
  • Loading branch information
thesan committed Feb 6, 2024
1 parent 107cf6d commit d0b8bbe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/ui/src/common/hooks/useSignAndSendTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useMyAccounts } from '@/accounts/hooks/useMyAccounts'
import { useApi } from '@/api/hooks/useApi'
import { getChainMetadata } from '@/api/utils/getChainMetadata'
import { BN_ZERO } from '@/common/constants'
import { error } from '@/common/logger'
import { getFeeSpendableBalance } from '@/common/providers/transactionFees/provider'

import { Address } from '../types'
Expand Down Expand Up @@ -57,7 +58,11 @@ export const useSignAndSendTransaction = ({
const sign = useCallback(() => {
if (wallet && api) {
return getChainMetadata(api).then(async (metadata) => {
await wallet.updateMetadata(metadata)
try {
await wallet.updateMetadata(metadata)
} catch {
error(`Pioneer could not update the Wallet (${wallet.extensionName}) metadata.`)
}
send('SIGN')
})
}
Expand Down

0 comments on commit d0b8bbe

Please sign in to comment.