Skip to content

Commit

Permalink
Fix nft icon sheet present & prioritize backup sheet (#6379)
Browse files Browse the repository at this point in the history
* give priority to backup sheet over nft icon unlocks, wrap nft icon unlocks in swipe layout handler

* revert wallet backup sheet priority
  • Loading branch information
maxbbb authored and ibrahimtaveras00 committed Jan 4, 2025
1 parent a193296 commit f215f49
Showing 1 changed file with 25 additions and 28 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

0 comments on commit f215f49

Please sign in to comment.