Skip to content

Commit 5713693

Browse files
committed
🎨 renamed error name in local storage
1 parent 7572668 commit 5713693

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

js/errorHandler.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
const msg = localStorage.getItem("streamit_404_error");
1+
const msg = localStorage.getItem("streamit_error");
22
const errorMessageEl = document.getElementById("error-message");
33
const errorCodeEl = document.getElementById("error-code");
44
const urlParams = new URLSearchParams(window.location.search);
55
const paramCode = urlParams.get("code");
66

77
if (msg && errorMessageEl) {
88
errorMessageEl.textContent = msg;
9-
localStorage.removeItem("streamit_404_error");
9+
localStorage.removeItem("streamit_error");
1010
} else if (msg && !errorMessageEl) {
11-
localStorage.removeItem("streamit_404_error");
11+
localStorage.removeItem("streamit_error");
1212
}
1313

1414
if (errorCodeEl) {
@@ -19,7 +19,7 @@ if (errorCodeEl) {
1919
}
2020

2121
function handleErrorAndRedirect(message, code = 404) {
22-
localStorage.setItem("streamit_404_error", message);
22+
localStorage.setItem("streamit_error", message);
2323
const safeCode = (typeof code === "number" || typeof code === "string") ? code : 404;
2424
window.location.href = `error.html?code=${encodeURIComponent(safeCode)}`;
2525
}

0 commit comments

Comments
 (0)