implement account id localstorage saving
This commit is contained in:
parent
f9bc80cc80
commit
75092f3e0e
3 changed files with 17 additions and 1 deletions
6
static/scripts/load.js
Normal file
6
static/scripts/load.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
// Loads an account ID and redirects
|
||||
const ls = window.localStorage;
|
||||
const maybeId = ls.getItem("beacon:account-id");
|
||||
if (maybeId) {
|
||||
window.location.pathname = `/${maybeId}`;
|
||||
}
|
6
static/scripts/save.js
Normal file
6
static/scripts/save.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
// Saves the account ID in local storage
|
||||
const id = document.getElementById("account-id");
|
||||
const ls = window.localStorage;
|
||||
if (id) {
|
||||
ls.setItem("beacon:account-id", id.innerHTML);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue