Skip to content

Commit

Permalink
fix(frontend): adjust local storage conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
drexhage committed Dec 23, 2023
1 parent 39900d2 commit 4826ef7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions frontend/src/lib/Editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
let session = { idx: $current, history: $history, preview: null };
let key = `local/default`;
let item = localStorage.getItem(key);
if (item) {
if (confirm('Replace stored local project with the current one?')) {
localStorage.setItem(key, JSON.stringify(session));
}
if (!item || confirm('Replace stored local project with the current one?')) {
localStorage.setItem(key, JSON.stringify(session));
}
window.location = `${base}/`;
}
Expand Down

0 comments on commit 4826ef7

Please sign in to comment.