From 1117a369823c46654f74fd72ed161cf92fcbeb11 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Mon, 29 Apr 2024 22:58:21 +0200 Subject: [PATCH] fix restore id --- src/js/main.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js/main.js b/src/js/main.js index de6e838b..3da64e39 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -112,6 +112,11 @@ define([ return array[Math.random() * array.length | 0]; } + function getId() { + const url = new URL(window.location.href); + return `${url.pathname}${url.search}`; + } + function ProgramManager(gl) { var _handlers = {}; var _programInfo; @@ -922,7 +927,7 @@ define([ if (!misc.deepCompare(settings, g.origSettings)) { g.restoreCleared = true; // just in case storage.setItem(s.restoreKey, JSON.stringify({ - pathname: window.location.pathname, + pathname: getId(), settings: settings, })); } @@ -1543,7 +1548,7 @@ define([ if (restoreStr) { try { var restore = JSON.parse(restoreStr); - if (restore.pathname === window.location.pathname) { + if (restore.pathname === getId()) { if (restore.settings.shader) { settings = restore.settings; }