Add warning message when window.localStorage is disabled
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import { History } from "./commands/history.js";
|
||||
|
||||
export function build(ctx) {
|
||||
let rec = JSON.parse(localStorage.getItem("knowns"));
|
||||
let rec = [];
|
||||
|
||||
if (!rec) {
|
||||
rec = [];
|
||||
try {
|
||||
rec = JSON.parse(localStorage.getItem("knowns"));
|
||||
|
||||
if (!rec) {
|
||||
rec = [];
|
||||
}
|
||||
} catch (e) {
|
||||
alert("Unable to load data of Known remotes: " + e);
|
||||
}
|
||||
|
||||
return new History(
|
||||
|
||||
Reference in New Issue
Block a user