diff --git a/src/routes/etf/[tickerID]/+layout.svelte b/src/routes/etf/[tickerID]/+layout.svelte index bdafff37..e695ec20 100644 --- a/src/routes/etf/[tickerID]/+layout.svelte +++ b/src/routes/etf/[tickerID]/+layout.svelte @@ -197,15 +197,14 @@ let LoginPopup; + $: if ($isOpen) { + websocketRealtimeData(); + } + onMount(async () => { if (!data?.user) { LoginPopup = (await import("$lib/components/LoginPopup.svelte")).default; } - - if ($isOpen) { - //&& currentDateTime > startTime && currentDateTime < endTime - await websocketRealtimeData(); - } }); afterUpdate(async () => { diff --git a/src/routes/stocks/[tickerID]/+layout.svelte b/src/routes/stocks/[tickerID]/+layout.svelte index 02ccc52b..2ddd9d06 100644 --- a/src/routes/stocks/[tickerID]/+layout.svelte +++ b/src/routes/stocks/[tickerID]/+layout.svelte @@ -205,14 +205,14 @@ let LoginPopup; + $: if ($isOpen) { + websocketRealtimeData(); + } + onMount(async () => { if (!data?.user) { LoginPopup = (await import("$lib/components/LoginPopup.svelte")).default; } - - if ($isOpen) { - await websocketRealtimeData(); - } }); afterUpdate(async () => {