Skip to content

Commit

Permalink
fix: updating references for shouldUpdateBalanceAmount (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrorezende authored Jun 5, 2024
1 parent 43dcfd3 commit 9f64ffe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/namadillo/src/hooks/useTransactionCallbacks.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useEffectSkipFirstRender } from "@namada/hooks";
import { useAtomValue, useSetAtom } from "jotai";
import { balancesAtom } from "slices/accounts";
import { shouldUpdateAmountAtom } from "slices/etc";
import { shouldUpdateBalanceAtom } from "slices/etc";
import { addTransactionEvent } from "utils";

export const useTransactionCallback = (): void => {
const { refetch: refetchBalances } = useAtomValue(balancesAtom);
const shouldUpdateBalance = useSetAtom(shouldUpdateAmountAtom);
const shouldUpdateBalance = useSetAtom(shouldUpdateBalanceAtom);

useEffectSkipFirstRender(() => {
initEvents();
Expand Down
4 changes: 2 additions & 2 deletions apps/namadillo/src/slices/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import BigNumber from "bignumber.js";
import { atomWithQuery } from "jotai-tanstack-query";
import { transparentAccountsAtom } from "./accounts";
import { chainAtom } from "./chain";
import { shouldUpdateAmountAtom } from "./etc";
import { shouldUpdateBalanceAtom } from "./etc";

type Unique = {
uuid: string;
Expand Down Expand Up @@ -61,7 +61,7 @@ export const myValidatorsAtom = atomWithQuery((get) => {
const accounts = get(transparentAccountsAtom);
const ids = accounts.map((account) => account.address).join("-");
// TODO: Refactor after this event subscription is enabled in the indexer
const enablePolling = get(shouldUpdateAmountAtom);
const enablePolling = get(shouldUpdateBalanceAtom);
return {
queryKey: ["my-validators", ids],
refetchInterval: enablePolling ? 1000 : false,
Expand Down

0 comments on commit 9f64ffe

Please sign in to comment.