From 2cffae1e435dcc6a0a6e036edb704289c0d1bf06 Mon Sep 17 00:00:00 2001 From: c-node Date: Tue, 28 Jun 2022 08:50:22 -0400 Subject: [PATCH] Stop Switchboard code from running on all DAOs (#785) * removed an irrelevant notification * handleGetSwitchboardVoting should not run on every DAO, only Switchboard DAO. Co-authored-by: Connor O'Hara --- hooks/useVotingPlugins.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hooks/useVotingPlugins.ts b/hooks/useVotingPlugins.ts index 9f34210a86..f3bc74a91c 100644 --- a/hooks/useVotingPlugins.ts +++ b/hooks/useVotingPlugins.ts @@ -267,10 +267,6 @@ export function useVotingPlugins() { } } catch (e) { console.log(e) - notify({ - message: "Something went wrong can't fetch switchboard voting power", - type: 'error', - }) } setIsLoading(false) } @@ -454,7 +450,14 @@ export function useVotingPlugins() { ]) useEffect(() => { - handleGetSwitchboardVoting() + + if ( + currentPluginPk && + switchboardPluginsPks.includes(currentPluginPk.toBase58()) + ) { + handleGetSwitchboardVoting() + } + if (usedCollectionsPks.length && realm) { if (connected && currentClient.walletPk?.toBase58()) { handleGetNfts()