mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-08 16:34:45 +08:00
Treat null new config as empty
localStorage.getItem() returns null for inexistent keys.
This commit is contained in:
parent
18141a52a6
commit
72c846416d
1 changed files with 1 additions and 1 deletions
|
|
@ -1665,7 +1665,7 @@ export function loadFromLocalStorage() {
|
|||
console.log("loading localStorage config");
|
||||
// let newConfig = $.cookie("config");
|
||||
let newConfig = window.localStorage.getItem("config");
|
||||
if (newConfig !== undefined && newConfig !== "") {
|
||||
if (newConfig !== undefined && newConfig !== null && newConfig !== "") {
|
||||
try {
|
||||
newConfig = JSON.parse(newConfig);
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue