Store stations list in localStorage for persistence across refresh
This commit is contained in:
parent
42fc294800
commit
fb3da4d211
@ -159,6 +159,8 @@ function handleMessage(message) {
|
||||
}
|
||||
}
|
||||
|
||||
localStorage.setItem("stations", JSON.stringify(stations));
|
||||
|
||||
redrawTable();
|
||||
}
|
||||
}
|
||||
@ -178,4 +180,7 @@ function connectToStream() {
|
||||
connectToStream();
|
||||
|
||||
window.addEventListener("load", redrawTable);
|
||||
window.addEventListener("load", () => {
|
||||
stations = JSON.parse(localStorage.getItem("stations") || '{}');
|
||||
});
|
||||
window.setInterval(redrawTable, 1000);
|
||||
|
Loading…
Reference in New Issue
Block a user