bugfixing websocket
This commit is contained in:
parent
e166bb7d19
commit
1af24ec844
@ -409,12 +409,12 @@
|
|||||||
|
|
||||||
$: stockList = [...stockList];
|
$: stockList = [...stockList];
|
||||||
|
|
||||||
|
$: if ($isOpen) {
|
||||||
|
websocketRealtimeData();
|
||||||
|
console.log("WebSocket restarted");
|
||||||
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
// Initialize the download worker if not already done
|
|
||||||
if ($isOpen) {
|
|
||||||
await websocketRealtimeData();
|
|
||||||
console.log("WebSocket restarted due to watchlist changes");
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
const savedRules = localStorage?.getItem(pagePathName);
|
const savedRules = localStorage?.getItem(pagePathName);
|
||||||
|
|
||||||
|
|||||||
@ -580,6 +580,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: if ($isOpen) {
|
||||||
|
websocketRealtimeData();
|
||||||
|
console.log("WebSocket restarted");
|
||||||
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
try {
|
try {
|
||||||
const savedRules = localStorage?.getItem("watchlist-ruleOfList");
|
const savedRules = localStorage?.getItem("watchlist-ruleOfList");
|
||||||
@ -648,10 +653,6 @@
|
|||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($isOpen) {
|
|
||||||
await websocketRealtimeData();
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("scroll", handleScroll);
|
window.addEventListener("scroll", handleScroll);
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener("scroll", handleScroll);
|
window.removeEventListener("scroll", handleScroll);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user