Skip to content

Commit

Permalink
Merge branch 'develop' into @christian/performance-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbaroni committed Jan 4, 2025
2 parents cbb3278 + 3bb8e9a commit 1543bdf
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 32 deletions.
53 changes: 25 additions & 28 deletions src/featuresToUnlock/unlockableAppIconCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Routes from '@/navigation/routesNames';
import { UnlockableAppIconKey, unlockableAppIcons } from '@/appIcons/appIcons';
import { MMKV } from 'react-native-mmkv';
import { STORAGE_IDS } from '@/model/mmkv';
import { triggerOnSwipeLayout } from '@/navigation/onNavigationStateChange';

export const unlockableAppIconStorage = new MMKV({
id: STORAGE_IDS.UNLOCKABLE_APP_ICONS,
Expand Down Expand Up @@ -62,38 +63,34 @@ export const unlockableAppIconCheck = async (appIconKey: UnlockableAppIconKey, w

logger.debug(`[unlockableAppIconCheck]: ${appIconKey} check result: ${found}`);

// We open the sheet with a setTimeout 1 sec later to make sure we can return first
// so we can abort early if we're showing a sheet to prevent 2+ sheets showing at the same time
if (found) {
unlockableAppIconStorage.set(appIconKey, true);
logger.debug(`[unlockableAppIconCheck]: Feature check ${appIconKey} set to true. Wont show up anymore!`);

setTimeout(() => {
if (found) {
unlockableAppIconStorage.set(appIconKey, true);
logger.debug(`[unlockableAppIconCheck]: Feature check ${appIconKey} set to true. Wont show up anymore!`);
// Temporarily ignore some icons
// We can get rid of this in 2025!
const iconsToIgnore = [
'optimism',
'smol',
'zora',
'golddoge',
'raindoge',
'pooly',
'finiliar',
'zorb',
'poolboy',
'adworld',
'farcaster',
];

// Temporarily ignore some icons
// We can get rid of this in 2025!
const iconsToIgnore = [
'optimism',
'smol',
'zora',
'golddoge',
'raindoge',
'pooly',
'finiliar',
'zorb',
'poolboy',
'adworld',
'farcaster',
];
if (iconsToIgnore.includes(appIconKey)) {
return false;
}

if (iconsToIgnore.includes(appIconKey)) {
return false;
}
triggerOnSwipeLayout(() => Navigation.handleAction(Routes.APP_ICON_UNLOCK_SHEET, { appIconKey }));

Navigation.handleAction(Routes.APP_ICON_UNLOCK_SHEET, { appIconKey });
return true;
}
}, 1000);
return true;
}
return found;
} catch (e) {
logger.error(new RainbowError('[unlockableAppIconCheck]: UnlockableAppIconCheck blew up'), { e });
Expand Down
8 changes: 7 additions & 1 deletion src/handlers/walletReadyEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ export const runWalletBackupStatusChecks = async (): Promise<boolean> => {
const { selected } = store.getState().wallets;
if (!selected || IS_TEST) return false;

if (!selected.backedUp && !selected.damaged && selected.type !== WalletTypes.readOnly && selected.type !== WalletTypes.bluetooth) {
if (
!selected.backedUp &&
!selected.damaged &&
!selected.imported &&
selected.type !== WalletTypes.readOnly &&
selected.type !== WalletTypes.bluetooth
) {
logger.debug('[walletReadyEvents]: Selected wallet is not backed up, prompting backup sheet');
return promptForBackupOnceReadyOrNotAvailable();
}
Expand Down
4 changes: 2 additions & 2 deletions src/resources/trendingTokens/trendingTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async function fetchTrendingTokens({
const trendingTokens: TrendingToken[] = [];

for (const token of response.trendingTokens.data) {
const { uniqueId, address, name, symbol, chainId, decimals, trending, market, icon_url, colors } = token;
const { address, name, symbol, chainId, decimals, trending, market, icon_url, colors } = token;
const { bought_stats } = trending.swap_data;
const highlightedFriends = (bought_stats.farcaster_users || []).reduce((friends, friend) => {
const { username, pfp_url } = friend;
Expand All @@ -81,7 +81,7 @@ async function fetchTrendingTokens({
}, [] as FarcasterUser[]);

trendingTokens.push({
uniqueId,
uniqueId: `${token.address}_${token.chainId}`,
chainId: chainId as ChainId,
address,
name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import WalletBackupTypes from '@/helpers/walletBackupTypes';
import WalletTypes, { EthereumWalletType } from '@/helpers/walletTypes';
import ImageAvatar from '@/components/contacts/ImageAvatar';
import { useENSAvatar, useInitializeWallet, useManageCloudBackups, useWallets } from '@/hooks';
import { useNavigation } from '@/navigation';
import { Navigation, useNavigation } from '@/navigation';
import { abbreviations, deviceUtils } from '@/utils';
import { addressHashedEmoji } from '@/utils/profileUtils';
import * as i18n from '@/languages';
Expand Down Expand Up @@ -38,6 +38,7 @@ import { executeFnIfCloudBackupAvailable } from '@/model/backup';
import { walletLoadingStore } from '@/state/walletLoading/walletLoading';
import { AbsolutePortalRoot } from '@/components/AbsolutePortal';
import { FlatList, ScrollView } from 'react-native';
import walletBackupStepTypes from '@/helpers/walletBackupStepTypes';

type WalletPillProps = {
account: RainbowAccount;
Expand Down Expand Up @@ -198,6 +199,9 @@ export const WalletsAndBackup = () => {
loadingState: null,
});
scrollviewRef.current?.scrollTo({ y: 0, animated: true });
Navigation.handleAction(Routes.BACKUP_SHEET, {
step: walletBackupStepTypes.backup_prompt,
});
}
},
});
Expand Down

0 comments on commit 1543bdf

Please sign in to comment.