Skip to content

Commit

Permalink
fix: disable single signer multisig
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisling-dev committed May 11, 2024
1 parent 1f454f9 commit 822121e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/multisig/src/layouts/Settings/SignersSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ export const SignersSettings: React.FC<Props> = ({ capHeight, editable, error, m
withAddressTooltip
/>
<Button
disabled={!editable}
size="icon"
variant="ghost"
onClick={editable && members.length > 1 ? () => handleRemove(m) : undefined}
onClick={members.length > 1 ? () => handleRemove(m) : undefined}
>
<Trash size={16} />
</Button>
Expand Down
1 change: 1 addition & 0 deletions apps/multisig/src/layouts/Settings/ThresholdSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type Props = {
export const ThresholdSettings: React.FC<Props> = ({ disabled, error, membersCount, onChange, threshold }) => {
useEffect(() => {
if (threshold > membersCount) onChange(membersCount)
else if (threshold < 2 && membersCount > 1) onChange(2)
}, [membersCount, onChange, threshold])
return (
<div css={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
Expand Down
2 changes: 1 addition & 1 deletion apps/multisig/src/layouts/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const Settings = () => {
Reset
</Button>
<Button
disabled={!changed || apiLoadable.state !== 'hasValue'}
disabled={!changed || apiLoadable.state !== 'hasValue' || newMembers.length < 2 || newThreshold < 2}
loading={changed && apiLoadable.state === 'loading'}
onClick={handleApplyChanges}
>
Expand Down

0 comments on commit 822121e

Please sign in to comment.