Skip to content
Permalink
Browse files

Prevent infinite recursion on Wayback Machine in Paint

  • Loading branch information
1j01 committed Jan 2, 2020
1 parent fc82af7 commit 6c01da5c2a0d235657ed4525708a46094fa12503
Showing with 7 additions and 1 deletion.
  1. +7 −1 programs/jspaint/src/sessions.js
@@ -562,11 +562,17 @@

}else{
log("No session ID in hash");
const old_hash = location.hash;
end_current_session();
const new_session_id = generate_session_id();
history.replaceState(null, document.title, `#local:${new_session_id}`);
log("After replaceState:", location.hash);
update_session_from_location_hash();
if (old_hash === location.hash) {
// e.g. on Wayback Machine
show_error_message("Autosave is disabled. Failed to update URL to start session.");
} else {
update_session_from_location_hash();
}
}
};

0 comments on commit 6c01da5

Please sign in to comment.
You can’t perform that action at this time.