* Optional close on council motions * No close available short-circuit
@@ -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
+ if (!api.tx.technicalCommittee.close) {
@@ -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);