Skip to content

Commit

Permalink
error handelling added (#3572)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityyaX authored Jan 10, 2024
1 parent 2599b79 commit d37ce3f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ $(document).ready(function() {
* The user's selected mode, stored in local storage.
* @type {string}
*/
var mode = localStorage.beginnerMode;
var mode;
try {
mode = localStorage.getItem("beginnerMode") || "true";
} catch (error) {
console.error("Error accessing localStorage:", error);

mode = "true";
}


/**
* The icon element that displays the user's current mode.
Expand Down

0 comments on commit d37ce3f

Please sign in to comment.