diff options
Diffstat (limited to 'frontend/start.js')
| -rw-r--r-- | frontend/start.js | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/frontend/start.js b/frontend/start.js index 2e71655..82e23aa 100644 --- a/frontend/start.js +++ b/frontend/start.js @@ -1,5 +1,11 @@ const startbtn = document.getElementById("startbtn"); +const urlParams = new URLSearchParams(window.location.search); +data.machine_id = urlParams.get('machine'); +console.log(urlParams); + +startUpdateMachines(); + (async () => { const timers = await fetchTimers(); @@ -43,8 +49,15 @@ startbtn.addEventListener("click", () => { start(); }); -const urlParams = new URLSearchParams(window.location.search); -data.machine_id = urlParams.get('machine'); -console.log(urlParams); - -startUpdateMachines(); +function rememberUrl() { + machineId = urlParams.get('machine'); + minutesDelta = 5; + expirationDate = new Date(new Date().getTime() + minutesDelta * 60000);; + cookieStore.set({ + expires: expirationDate, + name: "last_used_url", + value: machineId, + url: "https://laundryweb.altafcreator.com", + secure: true, + }) +} |
