Skip to content

Commit

Permalink
Merge pull request #1493 from Instadapp/hf/batch-modal-close
Browse files Browse the repository at this point in the history
fix: remove nested try-catch
  • Loading branch information
yulafezmesi authored Jan 10, 2024
2 parents 61689c0 + 9b4abfe commit d26bf31
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions components/modals/TransactionBatch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const { transactionStack } = storeToRefs(useShared())
const { removeActionsByChainId, removeActionsByMetadata } = useShared()
const { tokens } = storeToRefs(useTokens())
const { sendTransactions } = useAvocadoSafe()
const { switchToAvocadoNetwork } = useNetworks()
const { parseTransactionError } = useErrorHandler()
const loading = ref(false)
Expand Down Expand Up @@ -57,32 +56,19 @@ async function onSubmit() {
try {
loading.value = true
await switchToAvocadoNetwork()
for await (const action of multipleActions.value) {
try {
const hash = await sendTransactions(
action.actions,
action.chainId,
action.options,
'transfer',
)
if (hash) {
addTransactionToQueue({
hash,
chainId: action.chainId,
})
}
}
catch (e: any) {
const err = parseTransactionError(e)
openSnackbar({
message: err.formatted,
type: 'error',
const hash = await sendTransactions(
action.actions,
action.chainId,
action.options,
'transfer',
)
if (hash) {
addTransactionToQueue({
hash,
chainId: action.chainId,
})
continue
}
}
Expand Down

0 comments on commit d26bf31

Please sign in to comment.