Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nft icon sheet present & prioritize backup sheet #6379

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading