From c0ed6040f142a7474bcbc3fb87f698ca332f0988 Mon Sep 17 00:00:00 2001 From: agrippa Date: Fri, 29 Sep 2023 16:30:28 -0400 Subject: [PATCH] show council rules iff council isnt dormant (#1843) --- .../Details/WalletDetails/Info/Rules/index.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/treasuryV2/Details/WalletDetails/Info/Rules/index.tsx b/components/treasuryV2/Details/WalletDetails/Info/Rules/index.tsx index b368de4132..a89576e1f6 100644 --- a/components/treasuryV2/Details/WalletDetails/Info/Rules/index.tsx +++ b/components/treasuryV2/Details/WalletDetails/Info/Rules/index.tsx @@ -8,7 +8,7 @@ import { ScaleIcon, UserGroupIcon, } from '@heroicons/react/outline' -import { VoteThresholdType, VoteTipping } from '@solana/spl-governance' +import { GoverningTokenType, VoteTipping } from '@solana/spl-governance' import cx from 'classnames' import { useRouter } from 'next/router' @@ -29,6 +29,7 @@ import { useRealmCouncilMintInfoQuery, } from '@hooks/queries/mintInfo' import { useLegacyVoterWeight } from '@hooks/queries/governancePower' +import { useRealmConfigQuery } from '@hooks/queries/realmConfig' const UNIX_SECOND = 1 const UNIX_MINUTE = UNIX_SECOND * 60 @@ -93,17 +94,18 @@ export default function Rules(props: Props) { const router = useRouter() const { symbol } = router.query const { fmtUrlWithCluster } = useQueryContext() + const realmConfig = useRealmConfigQuery().data?.result const programVersion = useProgramVersion() const governanceConfig = props.wallet.governanceAccount?.account.config const communityEnabled = - governanceConfig && - governanceConfig.communityVoteThreshold.type !== VoteThresholdType.Disabled + realmConfig?.account.communityTokenConfig.tokenType !== + GoverningTokenType.Dormant const councilEnabled = - governanceConfig && - governanceConfig.councilVoteThreshold.type !== VoteThresholdType.Disabled + realmConfig?.account.councilTokenConfig.tokenType !== + GoverningTokenType.Dormant const canEditRules = ownVoterWeight &&