Update blue_modules/currency.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Marcos Rodriguez Vélez 2024-11-19 22:55:24 -04:00 committed by GitHub
parent 01ee103cc9
commit b3fc16fe64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -70,8 +70,12 @@ async function migrateAsyncStorageToDefaultPreference(): Promise<void> {
} catch (error) { } catch (error) {
console.error('Failed to parse exchange rates from AsyncStorage:', error); console.error('Failed to parse exchange rates from AsyncStorage:', error);
} finally { } finally {
await AsyncStorage.removeItem(EXCHANGE_RATES_STORAGE_KEY); } catch (error) {
} console.error('Failed to parse exchange rates from AsyncStorage:', error);
} else {
// Remove from AsyncStorage only if migration was successful
await AsyncStorage.removeItem(EXCHANGE_RATES_STORAGE_KEY);
}
} }
console.log('Migration from AsyncStorage to DefaultPreference completed.'); console.log('Migration from AsyncStorage to DefaultPreference completed.');