Ensure tech. comm is filtered by members (#3742)
This commit is contained in:
parent
95a8177df2
commit
3eaac6b81d
@ -90,6 +90,7 @@ function Proposal ({ className = '', imageHash, members, prime }: Props): React.
|
||||
{isVoteable && !isCloseable && (
|
||||
<Voting
|
||||
hash={imageHash}
|
||||
members={members}
|
||||
prime={prime}
|
||||
proposalId={index}
|
||||
/>
|
||||
|
||||
@ -12,11 +12,12 @@ import { useTranslation } from '../translate';
|
||||
|
||||
interface Props {
|
||||
hash: Hash | string;
|
||||
members: string[];
|
||||
prime?: AccountId | null;
|
||||
proposalId: BN | number;
|
||||
}
|
||||
|
||||
function Voting ({ hash, prime, proposalId }: Props): React.ReactElement<Props> | null {
|
||||
function Voting ({ hash, members, prime, proposalId }: Props): React.ReactElement<Props> | null {
|
||||
const { t } = useTranslation();
|
||||
const { hasAccounts } = useAccounts();
|
||||
const [accountId, setAccountId] = useState<string | null>(null);
|
||||
@ -26,8 +27,6 @@ function Voting ({ hash, prime, proposalId }: Props): React.ReactElement<Props>
|
||||
return null;
|
||||
}
|
||||
|
||||
const isPrime = accountId === prime?.toString();
|
||||
|
||||
return (
|
||||
<>
|
||||
{isVotingOpen && (
|
||||
@ -36,8 +35,11 @@ function Voting ({ hash, prime, proposalId }: Props): React.ReactElement<Props>
|
||||
size='small'
|
||||
>
|
||||
<Modal.Content>
|
||||
<VoteAccount onChange={setAccountId} />
|
||||
{isPrime && (
|
||||
<VoteAccount
|
||||
filter={members}
|
||||
onChange={setAccountId}
|
||||
/>
|
||||
{(accountId === prime?.toString()) && (
|
||||
<article className='warning'>
|
||||
<div>{t<string>('You are voting with this collective\'s prime account. The vote will be the default outcome in case of any abstentions.')}</div>
|
||||
</article>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user