Update conversions rates before sending them to websocket

This commit is contained in:
natsoni
2025-08-06 16:47:44 +02:00
parent b94698fe07
commit ac1072170f

View File

@@ -273,10 +273,6 @@ class PriceUpdater {
this.latestPrices.time = Math.round(new Date().getTime() / 1000);
logger.info(`Latest BTC fiat averaged price: ${JSON.stringify(this.latestPrices)}`);
if (this.ratesChangedCallback) {
this.ratesChangedCallback(this.latestPrices);
}
if (!forceUpdate) {
this.cyclePosition++;
}
@@ -284,6 +280,10 @@ class PriceUpdater {
if (this.latestPrices.USD === -1) {
this.latestPrices = await PricesRepository.$getLatestConversionRates();
}
if (this.ratesChangedCallback) {
this.ratesChangedCallback(this.latestPrices);
}
}
/**