This commit is contained in:
MuslemRahimi 2024-11-18 18:14:47 +01:00
parent e971f1a9df
commit 058925ed53
2 changed files with 5 additions and 3 deletions

View File

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

View File

@ -159,8 +159,9 @@
if ($stockTicker && typeof window !== "undefined") { if ($stockTicker && typeof window !== "undefined") {
// add a check to see if running on client-side // add a check to see if running on client-side
if ($realtimePrice !== null && $realtimePrice !== 0) { if ($realtimePrice !== null && $realtimePrice !== 0) {
$realtimePrice = $currentPortfolioPrice = $realtimePrice;
$realtimePrice !== 0 ? $realtimePrice : data?.getStockQuote?.price; } else if ($realtimePrice === null || $realtimePrice === 0) {
$realtimePrice = data?.getStockQuote?.price;
$currentPortfolioPrice = $realtimePrice; $currentPortfolioPrice = $realtimePrice;
} else if (oneDayPrice?.length !== 0) { } else if (oneDayPrice?.length !== 0) {
const length = oneDayPrice?.length; const length = oneDayPrice?.length;
@ -819,7 +820,7 @@
<div <div
class="text-2xl md:text-3xl font-bold text-white flex flex-row items-center w-full" class="text-2xl md:text-3xl font-bold text-white flex flex-row items-center w-full"
> >
{displayLegend?.close} {$realtimePrice ?? displayLegend?.close}
{#if $priceIncrease === true} {#if $priceIncrease === true}
<div <div