Show vote button even with no preimage (#8325)

This commit is contained in:
Jaco 2022-11-08 09:02:35 +02:00 committed by GitHub
parent 0dbfeb6fdc
commit 8d4d27782b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 18 deletions

View File

@ -126,16 +126,14 @@ function Ongoing ({ isMember, members, palletReferenda, palletVote, value: { id,
/>
</td>
<td className='button'>
{preimage && (
<Vote
id={id}
isConvictionVote={isConvictionVote}
isMember={isMember}
members={members}
palletVote={palletVote}
preimage={preimage}
/>
)}
<Vote
id={id}
isConvictionVote={isConvictionVote}
isMember={isMember}
members={members}
palletVote={palletVote}
preimage={preimage}
/>
</td>
</>
);

View File

@ -18,10 +18,10 @@ interface Props {
isMember: boolean;
members?: string[];
palletVote: PalletVote;
preimage: Preimage;
preimage?: Preimage;
}
function Voting ({ id, isConvictionVote, isMember, members, palletVote, preimage: { proposal } }: Props): React.ReactElement<Props> | null {
function Voting ({ id, isConvictionVote, isMember, members, palletVote, preimage }: Props): React.ReactElement<Props> | null {
const { t } = useTranslation();
const { api } = useApi();
const { hasAccounts } = useAccounts();
@ -43,12 +43,14 @@ function Voting ({ id, isConvictionVote, isMember, members, palletVote, preimage
size='large'
>
<Modal.Content>
<Modal.Columns hint={t<string>('If this proposal is passed, the changes will be applied via dispatch and the deposit returned.')}>
<ProposedAction
idNumber={id}
proposal={proposal}
/>
</Modal.Columns>
{preimage && (
<Modal.Columns hint={t<string>('If this proposal is passed, the changes will be applied via dispatch and the deposit returned.')}>
<ProposedAction
idNumber={id}
proposal={preimage.proposal}
/>
</Modal.Columns>
)}
<Modal.Columns hint={t<string>('The vote will be recorded for this account. If another account delegated to this one, the delegated votes will also be counted.')}>
<VoteAccount
filter={members}