From 6614b19843d39b1c195e970180c1bf4fb8da921a Mon Sep 17 00:00:00 2001 From: Kyle Mitchell Date: Sat, 12 Oct 2019 23:17:57 -0400 Subject: [PATCH] further fixed some exception checks --- js/index.js | 8 ++++---- js/options.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/index.js b/js/index.js index 5f4e40c..3bd6c2e 100644 --- a/js/index.js +++ b/js/index.js @@ -3,10 +3,10 @@ function restore_options() { console.log("Loading Settings", result) var quads = document.getElementsByClassName("quadrant") var style = document.createElement("style") - if (! typeof result === "undefined") { - if (! typeof result.links) result.links = [] - if (! typeof result.colors) result.colors = [] - if (! typeof result.mode) result.mode = "light" + if (!(typeof result === 'undefined')) { + if (!(typeof result.links)) result.links = [] + if (!(typeof result.colors)) result.colors = [] + if (!(typeof result.mode)) result.mode = "light" for (i = 0; i < quads.length; i++) { if (i < result.links.length) { var link = result.links[i] diff --git a/js/options.js b/js/options.js index 49a639f..a7b7cfe 100644 --- a/js/options.js +++ b/js/options.js @@ -21,10 +21,10 @@ function restore_options() { console.log("Loading Settings", result) var input_links = document.querySelectorAll('input[type="text"]') var input_colors = document.querySelectorAll('input[type="color"]') - if (! typeof result === "undefined") { - if (! typeof result.links) result.links = [] - if (! typeof result.colors) result.colors = [] - if (! typeof result.mode) result.mode = "light" + if (!(typeof result === 'undefined')) { + if (!(typeof result.links)) result.links = [] + if (!(typeof result.colors)) result.colors = [] + if (!(typeof result.mode)) result.mode = "light" for (i = 0; i < input_links.length; i++) { if (i < result.links.length) { input_links[i].value = result.links[i]