Optional close on council motions (#3252)
* Optional close on council motions * No close available short-circuit
This commit is contained in:
parent
87f2fd1626
commit
d35b1a1d10
@ -26,6 +26,11 @@ function Close ({ hasFailed, hash, idNumber, isDisabled, members, proposal }: Pr
|
||||
const [accountId, setAccountId] = useState<string | null>(null);
|
||||
const [proposalWeight, proposalLength] = useWeight(proposal);
|
||||
|
||||
// protect against older versions
|
||||
if (!api.tx.council.close) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{isOpen && (
|
||||
|
||||
@ -26,6 +26,10 @@ function Close ({ hasFailed, hash, idNumber, isDisabled, members, proposal }: Pr
|
||||
const [accountId, setAccountId] = useState<string | null>(null);
|
||||
const [proposalWeight, proposalLength] = useWeight(proposal);
|
||||
|
||||
if (!api.tx.technicalCommittee.close) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{isOpen && (
|
||||
|
||||
@ -37,9 +37,9 @@ function getStatus (api: ApiPromise, bestNumber: BlockNumber, votes: Votes, numM
|
||||
return {
|
||||
hasFailed,
|
||||
hasPassed,
|
||||
isCloseable: api.tx[section].close.meta.args.length === 2
|
||||
? isEnd
|
||||
: isEnd || hasPassed || hasFailed,
|
||||
isCloseable: api.tx[section].close?.meta.args.length === 4 // current-generation
|
||||
? isEnd || hasPassed || hasFailed
|
||||
: isEnd,
|
||||
isVoteable: !isEnd,
|
||||
remainingBlocks: isEnd
|
||||
? null
|
||||
|
||||
@ -16,7 +16,7 @@ const DOMAIN = 'dotapps.io';
|
||||
const DST = 'packages/apps/build';
|
||||
const SRC = 'packages/apps/public';
|
||||
const WOPTS = { encoding: 'utf8', flag: 'w' };
|
||||
const PINMETA = { name: 'dotapps.io' };
|
||||
const PINMETA = { name: DOMAIN };
|
||||
|
||||
const repo = `https://${process.env.GH_PAT}@github.com/${process.env.GITHUB_REPOSITORY}.git`;
|
||||
const pinata = pinataSDK(process.env.PINATA_API_KEY, process.env.PINATA_SECRET_KEY);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user