mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-18 13:26:33 +01:00
FIX: Restore stored fiat preference on launch
This commit is contained in:
parent
3030d3cf02
commit
b28bf884d7
@ -113,6 +113,11 @@ async function isRateOutdated(): Promise<boolean> {
|
||||
}
|
||||
}
|
||||
|
||||
async function restoreSavedPreferredFiatCurrencyAndExchangeFromStorage(): Promise<void> {
|
||||
await _restoreSavedExchangeRatesFromStorage();
|
||||
await _restoreSavedPreferredFiatCurrencyFromStorage();
|
||||
}
|
||||
|
||||
async function initCurrencyDaemon(clearLastUpdatedTime: boolean = false): Promise<void> {
|
||||
await _restoreSavedExchangeRatesFromStorage();
|
||||
await _restoreSavedPreferredFiatCurrencyFromStorage();
|
||||
@ -235,4 +240,5 @@ export {
|
||||
LAST_UPDATED,
|
||||
mostRecentFetchedRate,
|
||||
isRateOutdated,
|
||||
restoreSavedPreferredFiatCurrencyAndExchangeFromStorage,
|
||||
};
|
||||
|
2
index.js
2
index.js
@ -7,6 +7,7 @@ import App from './App';
|
||||
import { BlueStorageProvider } from './blue_modules/storage-context';
|
||||
import A from './blue_modules/analytics';
|
||||
import { SettingsProvider } from './components/Context/SettingsContext';
|
||||
import { restoreSavedPreferredFiatCurrencyAndExchangeFromStorage } from './blue_modules/currency';
|
||||
|
||||
if (!Error.captureStackTrace) {
|
||||
// captureStackTrace is only available when debugging
|
||||
@ -15,6 +16,7 @@ if (!Error.captureStackTrace) {
|
||||
|
||||
const BlueAppComponent = () => {
|
||||
useEffect(() => {
|
||||
restoreSavedPreferredFiatCurrencyAndExchangeFromStorage();
|
||||
A(A.ENUM.INIT);
|
||||
}, []);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user