add local storage markers

This commit is contained in:
Kizarm 2024-10-27 15:57:23 +01:00
parent 26ac333c82
commit e79f5facff

View file

@ -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) {