Skip to content

Commit

Permalink
Stop Switchboard code from running on all DAOs (solana-labs#785)
Browse files Browse the repository at this point in the history
* removed an irrelevant notification

* handleGetSwitchboardVoting should not run on every DAO, only Switchboard DAO.

Co-authored-by: Connor O'Hara <[email protected]>
  • Loading branch information
S1nus and Connor O'Hara authored Jun 28, 2022
1 parent a906dcd commit 2cffae1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions hooks/useVotingPlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 2cffae1

Please sign in to comment.