Skip to content

Commit

Permalink
Fix: display submit error separately
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Aug 31, 2023
1 parent 9bfa05f commit dd41a50
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/components/tx/SignOrExecuteForm/ExecuteForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ReactElement, type SyntheticEvent, useContext, useState } from 'react'
import { Button, CardActions, Divider } from '@mui/material'
import { Box, Button, CardActions, Divider } from '@mui/material'
import classNames from 'classnames'

import ErrorMessage from '@/components/tx/ErrorMessage'
Expand Down Expand Up @@ -137,17 +137,21 @@ const ExecuteForm = ({
<ErrorMessage>
Cannot execute a transaction from the Safe Account itself, please connect a different account.
</ErrorMessage>
) : executionValidationError || gasLimitError ? (
<ErrorMessage error={executionValidationError || gasLimitError}>
This transaction will most likely fail.
{` To save gas costs, ${isCreation ? 'avoid creating' : 'reject'} this transaction.`}
</ErrorMessage>
) : (
submitError && (
<ErrorMessage error={submitError}>Error submitting the transaction. Please try again.</ErrorMessage>
(executionValidationError || gasLimitError) && (
<ErrorMessage error={executionValidationError || gasLimitError}>
This transaction will most likely fail.
{` To save gas costs, ${isCreation ? 'avoid creating' : 'reject'} this transaction.`}
</ErrorMessage>
)
)}

{submitError && (
<Box mt={1}>
<ErrorMessage error={submitError}>Error submitting the transaction. Please try again.</ErrorMessage>
</Box>
)}

<Divider className={commonCss.nestedDivider} sx={{ pt: 3 }} />

<CardActions>
Expand Down

0 comments on commit dd41a50

Please sign in to comment.