diff --git a/src/featuresToUnlock/unlockableAppIconCheck.ts b/src/featuresToUnlock/unlockableAppIconCheck.ts index 0eaef6b9514..d1fdee6ac80 100644 --- a/src/featuresToUnlock/unlockableAppIconCheck.ts +++ b/src/featuresToUnlock/unlockableAppIconCheck.ts @@ -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, @@ -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 }); diff --git a/src/handlers/walletReadyEvents.ts b/src/handlers/walletReadyEvents.ts index b8e53674c66..1b7604e382a 100644 --- a/src/handlers/walletReadyEvents.ts +++ b/src/handlers/walletReadyEvents.ts @@ -88,13 +88,13 @@ export const runFeatureUnlockChecks = async (): Promise => { }; export const runFeaturesLocalCampaignAndBackupChecks = async () => { - if (await runFeatureUnlockChecks()) { + if (await runWalletBackupStatusChecks()) { return true; } - if (await runLocalCampaignChecks()) { + if (await runFeatureUnlockChecks()) { return true; } - if (await runWalletBackupStatusChecks()) { + if (await runLocalCampaignChecks()) { return true; }