From 4ae511db188f81b196befd6dd5337e478d5d3bac Mon Sep 17 00:00:00 2001 From: tarikgul Date: Tue, 24 Sep 2024 22:29:21 -0400 Subject: [PATCH] Fix Treasury Page in Kusama --- packages/apps-routing/src/treasury.ts | 2 +- packages/page-treasury/src/Overview/ProposalCreate.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/apps-routing/src/treasury.ts b/packages/apps-routing/src/treasury.ts index b051ca3d7668..1575f9914a00 100644 --- a/packages/apps-routing/src/treasury.ts +++ b/packages/apps-routing/src/treasury.ts @@ -10,7 +10,7 @@ export default function create (t: TFunction): Route { Component, display: { needsApi: [ - 'tx.treasury.proposeSpend' + 'tx.treasury.checkStatus' ] }, group: 'governance', diff --git a/packages/page-treasury/src/Overview/ProposalCreate.tsx b/packages/page-treasury/src/Overview/ProposalCreate.tsx index 562a364d9727..76bc28ccd222 100644 --- a/packages/page-treasury/src/Overview/ProposalCreate.tsx +++ b/packages/page-treasury/src/Overview/ProposalCreate.tsx @@ -3,7 +3,7 @@ import type { Option, u128 } from '@polkadot/types'; import type { Permill } from '@polkadot/types/interfaces'; -import type { BN } from '@polkadot/util'; +import { BN } from '@polkadot/util'; import React, { useMemo, useState } from 'react'; @@ -28,11 +28,11 @@ function Propose ({ className }: Props): React.ReactElement | null { const [bondMin, bondMax, bondPercentage] = useMemo( () => [ - (api.consts.treasury.proposalBondMinimum as u128).toString(), - (api.consts.treasury.proposalBondMaximum as Option)?.isSome + api.consts.treasury.proposalBondMinimum ? (api.consts.treasury.proposalBondMinimum as u128).toString() : new BN(0), + api.consts.treasury.proposalBondMaximum && (api.consts.treasury.proposalBondMaximum as Option)?.isSome ? (api.consts.treasury.proposalBondMaximum as Option).unwrap().toString() : null, - `${(api.consts.treasury.proposalBond as Permill).mul(BN_HUNDRED).div(BN_MILLION).toNumber().toFixed(2)}%` + api.consts.treasury.proposalBond ? `${(api.consts.treasury.proposalBond as Permill).mul(BN_HUNDRED).div(BN_MILLION).toNumber().toFixed(2)}%` : `0%` ], [api] );