asdsa
This commit is contained in:
@@ -220,9 +220,12 @@
|
||||
const base = String(
|
||||
settings.display_base_currency || settings.default_base_currency || 'EUR'
|
||||
).trim().toUpperCase();
|
||||
const historyCurrencies = preferredCurrencies.filter((currency) => currency !== base);
|
||||
const selectedCurrencies = preferredCurrencies.length
|
||||
? preferredCurrencies
|
||||
: [base];
|
||||
const historyCurrencies = selectedCurrencies.filter((currency) => currency !== base);
|
||||
|
||||
if (!historyCurrencies.length) {
|
||||
if (!selectedCurrencies.length) {
|
||||
renderHistory([], []);
|
||||
return;
|
||||
}
|
||||
@@ -244,7 +247,7 @@
|
||||
byDate.set(key, {
|
||||
sortKey: key,
|
||||
label: row?.fetched_at_display || row?.fetched_at || row?.rate_date || key,
|
||||
rates: {},
|
||||
rates: base !== '' ? { [base]: 1 } : {},
|
||||
});
|
||||
}
|
||||
const entry = byDate.get(key);
|
||||
@@ -257,7 +260,7 @@
|
||||
const mergedRows = Array.from(byDate.values())
|
||||
.sort((left, right) => String(left.sortKey).localeCompare(String(right.sortKey)));
|
||||
|
||||
renderHistory(mergedRows, historyCurrencies);
|
||||
renderHistory(mergedRows, selectedCurrencies);
|
||||
};
|
||||
|
||||
const calculateConversion = async () => {
|
||||
@@ -307,9 +310,7 @@
|
||||
|
||||
loadLatest().catch(() => {});
|
||||
loadHistory().catch(() => {
|
||||
renderHistory([], preferredCurrencies.filter((currency) => currency !== String(
|
||||
settings.display_base_currency || settings.default_base_currency || 'EUR'
|
||||
).trim().toUpperCase()));
|
||||
renderHistory([], preferredCurrencies);
|
||||
});
|
||||
calculateConversion().catch(() => {});
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user