Skip to content

Commit

Permalink
icons hotfix pt 2 (#6345)
Browse files Browse the repository at this point in the history
* added migration to reset icon handled flag

* ignore old icon sheets temporarilly
  • Loading branch information
brunobar79 authored and ibrahimtaveras00 committed Dec 17, 2024
1 parent e0fc97d commit b4f5839
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/featuresToUnlock/unlockableAppIconCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,26 @@ export const unlockableAppIconCheck = async (appIconKey: UnlockableAppIconKey, w
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',
];

if (iconsToIgnore.includes(appIconKey)) {
return false;
}

Navigation.handleAction(Routes.APP_ICON_UNLOCK_SHEET, { appIconKey });
return true;
}
Expand Down
16 changes: 16 additions & 0 deletions src/model/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ import { useLegacyFavoriteDappsStore } from '@/state/legacyFavoriteDapps';
import { getAddressAndChainIdFromUniqueId, getUniqueId, getUniqueIdNetwork } from '@/utils/ethereumUtils';
import { UniqueId } from '@/__swaps__/types/assets';
import { userAssetsStore } from '@/state/assets/userAssets';
import { UnlockableAppIconKey, unlockableAppIcons } from '@/appIcons/appIcons';
import { unlockableAppIconStorage } from '@/featuresToUnlock/unlockableAppIconCheck';

export default async function runMigrations() {
// get current version
Expand Down Expand Up @@ -696,6 +698,20 @@ export default async function runMigrations() {

migrations.push(v21);

/**
*************** Migration v22 ******************
* Reset icon checks
*/
const v22 = async () => {
// For each appIcon, delete the handled flag
(Object.keys(unlockableAppIcons) as UnlockableAppIconKey[]).map(appIconKey => {
unlockableAppIconStorage.delete(appIconKey);
logger.debug('Resetting icon status for ' + appIconKey);
});
};

migrations.push(v22);

logger.debug(`[runMigrations]: ready to run migrations starting on number ${currentVersion}`);
// await setMigrationVersion(17);
if (migrations.length === currentVersion) {
Expand Down

0 comments on commit b4f5839

Please sign in to comment.