Skip to content

Commit

Permalink
fix(suite): fix defualt value for hideOnLargeScreens
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-sanderson authored and tomasklim committed May 7, 2024
1 parent 655af47 commit 5866769
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const StyledSwitch = styled(Switch)<{
$hideOnSmallScreens?: boolean;
}>`
${({ $hideOnLargeScreens }) =>
$hideOnLargeScreens &&
$hideOnLargeScreens === true &&
css`
${breakpointMediaQueries.lg} {
display: none;
Expand Down
10 changes: 9 additions & 1 deletion suite-common/wallet-core/src/fiat-rates/fiatRatesReducer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createReducerWithExtraDeps } from '@suite-common/redux-utils';
import { Timestamp } from '@suite-common/wallet-types';
import { getFiatRateKeyFromTicker } from '@suite-common/wallet-utils';
import { getFiatRateKeyFromTicker, isTestnet } from '@suite-common/wallet-utils';

import { updateFiatRatesThunk } from './fiatRatesThunks';
import { FiatRatesState } from './fiatRatesTypes';
Expand All @@ -19,6 +19,10 @@ export const prepareFiatRatesReducer = createReducerWithExtraDeps(
const fiatRateKey = getFiatRateKeyFromTicker(ticker, localCurrency);
let currentRate = state[rateType]?.[fiatRateKey];

if (isTestnet(ticker.symbol)) {
return;
}

if (currentRate) {
currentRate = {
...currentRate,
Expand Down Expand Up @@ -63,6 +67,10 @@ export const prepareFiatRatesReducer = createReducerWithExtraDeps(
const fiatRateKey = getFiatRateKeyFromTicker(ticker, localCurrency);
const currentRate = state[rateType]?.[fiatRateKey];

if (isTestnet(ticker.symbol)) {
return;
}

// To prevent race condition someone will remove rate from state while fetching for example (during currency change etc.)
if (!currentRate) {
return;
Expand Down
4 changes: 3 additions & 1 deletion suite-common/wallet-core/src/fiat-rates/fiatRatesThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export const updateFiatRatesThunk = createThunk(
{ ticker, localCurrency, rateType, forceFetchToken }: UpdateCurrentFiatRatesThunkPayload,
{ getState },
) => {
if (isTestnet(ticker.symbol)) return;
if (isTestnet(ticker.symbol)) {
throw new Error('Testnet');
}

const hasCoinDefinitions = getNetworkFeatures(ticker.symbol).includes('coin-definitions');
if (ticker.tokenAddress && hasCoinDefinitions && !forceFetchToken) {
Expand Down

0 comments on commit 5866769

Please sign in to comment.