asdsa
All checks were successful
Deploy / deploy-staging (push) Successful in 6s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-05-01 02:53:21 +02:00
parent 6ce45f6d23
commit 29e2724cd8

View File

@@ -220,9 +220,12 @@
const base = String( const base = String(
settings.display_base_currency || settings.default_base_currency || 'EUR' settings.display_base_currency || settings.default_base_currency || 'EUR'
).trim().toUpperCase(); ).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([], []); renderHistory([], []);
return; return;
} }
@@ -244,7 +247,7 @@
byDate.set(key, { byDate.set(key, {
sortKey: key, sortKey: key,
label: row?.fetched_at_display || row?.fetched_at || row?.rate_date || key, label: row?.fetched_at_display || row?.fetched_at || row?.rate_date || key,
rates: {}, rates: base !== '' ? { [base]: 1 } : {},
}); });
} }
const entry = byDate.get(key); const entry = byDate.get(key);
@@ -257,7 +260,7 @@
const mergedRows = Array.from(byDate.values()) const mergedRows = Array.from(byDate.values())
.sort((left, right) => String(left.sortKey).localeCompare(String(right.sortKey))); .sort((left, right) => String(left.sortKey).localeCompare(String(right.sortKey)));
renderHistory(mergedRows, historyCurrencies); renderHistory(mergedRows, selectedCurrencies);
}; };
const calculateConversion = async () => { const calculateConversion = async () => {
@@ -307,9 +310,7 @@
loadLatest().catch(() => {}); loadLatest().catch(() => {});
loadHistory().catch(() => { loadHistory().catch(() => {
renderHistory([], preferredCurrencies.filter((currency) => currency !== String( renderHistory([], preferredCurrencies);
settings.display_base_currency || settings.default_base_currency || 'EUR'
).trim().toUpperCase()));
}); });
calculateConversion().catch(() => {}); calculateConversion().catch(() => {});
})(); })();