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