update websocket

This commit is contained in:
MuslemRahimi 2024-11-26 18:39:09 +01:00
parent e779130d41
commit 2fba46d439
2 changed files with 2 additions and 2 deletions

View File

@ -174,7 +174,7 @@
} else if (type === "Q") {
$wsBidPrice = typeof bp !== "undefined" ? bp : null;
$wsAskPrice = typeof ap !== "undefined" ? ap : null;
$realtimePrice = $wsAskPrice;
$realtimePrice = typeof lp !== "undefined" ? lp : $wsAskPrice;
}
// Update price increase state

View File

@ -150,7 +150,7 @@
if (newItem) {
// Calculate the new changePercentage
const baseLine = item?.price / (1 + item?.changesPercentage / 100);
const newPrice = newItem?.ap;
const newPrice = newItem?.lp;
const newChangePercentage = (newPrice / baseLine - 1) * 100;
// Update the item directly in the oldList