feat: fetch exchange rates immediately on startup

Start fetching exchange rates immediately upon initialization, ensuring the most current data is available from the outset. This prevents potential inaccuracies during initial use if rates are only fetched after the interval delay.
This commit is contained in:
Kumi 2024-08-09 08:12:58 +02:00
parent 31cadc232b
commit a1ccf0b43b
No known key found for this signature in database
GPG key ID: ECBCC9082395383F

View file

@ -62,7 +62,8 @@ document.addEventListener('DOMContentLoaded', function () {
}
});
// Fetch updated exchange rates every 5 seconds
// Fetch updated exchange rates immediately, then every 5 seconds
fetchUpdatedExchangeRates();
setInterval(fetchUpdatedExchangeRates, 5000);
});