Skip to content

Commit

Permalink
fix restore id
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Apr 29, 2024
1 parent c572358 commit 1117a36
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
}));
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 1117a36

Please sign in to comment.