mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-18 21:35:21 +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> {
|
async function initCurrencyDaemon(clearLastUpdatedTime: boolean = false): Promise<void> {
|
||||||
await _restoreSavedExchangeRatesFromStorage();
|
await _restoreSavedExchangeRatesFromStorage();
|
||||||
await _restoreSavedPreferredFiatCurrencyFromStorage();
|
await _restoreSavedPreferredFiatCurrencyFromStorage();
|
||||||
@ -235,4 +240,5 @@ export {
|
|||||||
LAST_UPDATED,
|
LAST_UPDATED,
|
||||||
mostRecentFetchedRate,
|
mostRecentFetchedRate,
|
||||||
isRateOutdated,
|
isRateOutdated,
|
||||||
|
restoreSavedPreferredFiatCurrencyAndExchangeFromStorage,
|
||||||
};
|
};
|
||||||
|
2
index.js
2
index.js
@ -7,6 +7,7 @@ import App from './App';
|
|||||||
import { BlueStorageProvider } from './blue_modules/storage-context';
|
import { BlueStorageProvider } from './blue_modules/storage-context';
|
||||||
import A from './blue_modules/analytics';
|
import A from './blue_modules/analytics';
|
||||||
import { SettingsProvider } from './components/Context/SettingsContext';
|
import { SettingsProvider } from './components/Context/SettingsContext';
|
||||||
|
import { restoreSavedPreferredFiatCurrencyAndExchangeFromStorage } from './blue_modules/currency';
|
||||||
|
|
||||||
if (!Error.captureStackTrace) {
|
if (!Error.captureStackTrace) {
|
||||||
// captureStackTrace is only available when debugging
|
// captureStackTrace is only available when debugging
|
||||||
@ -15,6 +16,7 @@ if (!Error.captureStackTrace) {
|
|||||||
|
|
||||||
const BlueAppComponent = () => {
|
const BlueAppComponent = () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
restoreSavedPreferredFiatCurrencyAndExchangeFromStorage();
|
||||||
A(A.ENUM.INIT);
|
A(A.ENUM.INIT);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user