Skip to content

Commit

Permalink
fix: switched from cookie from localStorage
Browse files Browse the repository at this point in the history
max cookie size is 4KB which is like 3-4 solves, max localStorage is 4-5MB which is more than enough for now
  • Loading branch information
Majestic9169 committed May 28, 2024
1 parent 90b5ad1 commit d46c079
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<body>
<h1>Welcome</h1>
<button class="menu" id="reconDB">reconDB</button>
<button class="menu" id="reconDB" onclick="location.href='recon.html';">reconDB</button>
<button class="menu" id="make-dump">submit a recon</button>
<br><br>
<div id="show-dump" style="display: none;">
Expand All @@ -31,4 +31,4 @@ <h1>Welcome</h1>

</body>

</html>
</html>
3 changes: 2 additions & 1 deletion recon.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ function getCookie(name) {
}

// getting my recnostruction cookie
let reconstruction = getCookie("reconstruction");
// let reconstruction = getCookie("reconstruction");
let reconstruction = localStorage.getItem("reconstruction");
reconstruction = JSON.parse(reconstruction);
console.log(reconstruction);

Expand Down
3 changes: 2 additions & 1 deletion solve.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ function saveSolve(solve) {
reconstruction.solves[currentSolveNumber - 1].push();
reconstruction.solves[currentSolveNumber - 1][2] = solve;
console.log(reconstruction);
setCookie("reconstruction", JSON.stringify(reconstruction), 3);
// setCookie("reconstruction", JSON.stringify(reconstruction), 3);
localStorage.setItem("reconstruction", JSON.stringify(reconstruction));
}

// EVENT LISTENER
Expand Down

0 comments on commit d46c079

Please sign in to comment.