Skip to content

Commit

Permalink
fix: Delete proposer as proposer, adjust status widget
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Nov 7, 2024
1 parent 430f45e commit 63695ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/components/tx-flow/common/TxStatusWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import CloseIcon from '@mui/icons-material/Close'
import useWallet from '@/hooks/wallets/useWallet'
import SafeLogo from '@/public/images/logo-no-text.svg'
import { SafeTxContext } from '@/components/tx-flow/SafeTxProvider'
import useIsSafeOwner from '@/hooks/useIsSafeOwner'
import { useIsWalletProposer } from '@/hooks/useProposers'

const TxStatusWidget = ({
step,
Expand All @@ -29,12 +31,18 @@ const TxStatusWidget = ({
const { safe } = useSafeInfo()
const { nonceNeeded } = useContext(SafeTxContext)
const { threshold } = safe
const isSafeOwner = useIsSafeOwner()
const isProposer = useIsWalletProposer()
const isProposing = isProposer && !isSafeOwner

const { executionInfo = undefined } = txSummary || {}
const { confirmationsSubmitted = 0 } = isMultisigExecutionInfo(executionInfo) ? executionInfo : {}

const canConfirm = txSummary ? isConfirmableBy(txSummary, wallet?.address || '') : safe.threshold === 1
const canSign = txSummary ? isSignableBy(txSummary, wallet?.address || '') : true
const canConfirm = txSummary
? isConfirmableBy(txSummary, wallet?.address || '')
: safe.threshold === 1 && !isProposing

const canSign = txSummary ? isSignableBy(txSummary, wallet?.address || '') : !isProposing

return (
<Paper>
Expand Down
2 changes: 1 addition & 1 deletion src/features/proposers/components/DeleteProposerDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const _DeleteProposer = ({ wallet, safeAddress, chainId, proposer }: DeletePropo
await deleteProposer({
chainId,
delegateAddress: proposer.delegate,
delegator: wallet.address,
delegator: proposer.delegator,
safeAddress,
signature,
isHardwareWallet: hardwareWallet,
Expand Down

0 comments on commit 63695ad

Please sign in to comment.