Skip to content

Commit

Permalink
perf: do not load existing info in popups
Browse files Browse the repository at this point in the history
  • Loading branch information
CedrikNikita committed Mar 6, 2025
1 parent 7d55ad8 commit da1544d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/composables/currencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {
import {
CURRENCIES,
DEFAULT_LOCALE,
RUNNING_IN_POPUP,
STORAGE_KEYS,
} from '@/constants';
import {
Expand Down Expand Up @@ -153,7 +154,7 @@ export function useCurrencies({
return (converted < 0.01) ? `<${formatCurrency(0.01)}` : formatCurrency(converted);
}

if (!pollingDisabled) {
if (!pollingDisabled || !RUNNING_IN_POPUP) {
initPollingWatcher(() => loadCurrencyRates());
}

Expand Down
13 changes: 10 additions & 3 deletions src/composables/fungibleTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ import type {
Dictionary,
ITx,
} from '@/types';
import { PROTOCOLS, STORAGE_KEYS, TX_DIRECTION } from '@/constants';
import {
PROTOCOLS,
RUNNING_IN_POPUP,
STORAGE_KEYS,
TX_DIRECTION,
} from '@/constants';
import { ProtocolAdapterFactory } from '@/lib/ProtocolAdapterFactory';

import FungibleTokenFullInterfaceACI from '@/protocols/aeternity/aci/FungibleTokenFullInterfaceACI.json';
Expand Down Expand Up @@ -319,8 +324,10 @@ export function useFungibleTokens() {
.plus(isReceived ? 0 : gasCost));
}

availableTokensPooling(() => loadAvailableTokens());
tokenBalancesPooling(() => loadTokenBalances());
if (!RUNNING_IN_POPUP) {
availableTokensPooling(() => loadAvailableTokens());
tokenBalancesPooling(() => loadTokenBalances());
}

if (!composableInitialized) {
composableInitialized = true;
Expand Down

0 comments on commit da1544d

Please sign in to comment.