From e79f5facffaa9ecb1065e1f1b36a22e4a565747b Mon Sep 17 00:00:00 2001 From: Kizarm Date: Sun, 27 Oct 2024 15:57:23 +0100 Subject: [PATCH] add local storage markers --- V203/usb/scope/bin/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/V203/usb/scope/bin/index.js b/V203/usb/scope/bin/index.js index ec86fea..61ef536 100644 --- a/V203/usb/scope/bin/index.js +++ b/V203/usb/scope/bin/index.js @@ -57,11 +57,17 @@ function initWebSocket() { websocket.onopen = function (evt) { ConnectBut.value = 'Disconnect'; Connected.innerHTML = 'CONNECTED'; + const stored = localStorage.getItem ('mark_store'); + console.log (stored); + if (stored) { + gMark = JSON.parse (stored); + } connected = true; }; websocket.onclose = function (evt) { ConnectBut.value = 'Connect'; Connected.innerHTML = 'DISCONNECTED'; + localStorage.setItem ('mark_store', JSON.stringify (gMark)); connected = false; }; websocket.onmessage = function (evt) {