From 5b8382c7f668c960343781acaa9dae66deab2d29 Mon Sep 17 00:00:00 2001 From: David Evans Date: Sun, 19 Jan 2020 23:02:17 +0000 Subject: [PATCH] Remove redundant checks in LocalStorage --- web/lib/editor.js | 6 ------ web/scripts/storage/LocalStorage.mjs | 6 ------ 2 files changed, 12 deletions(-) diff --git a/web/lib/editor.js b/web/lib/editor.js index be55460..64b8cd5 100644 --- a/web/lib/editor.js +++ b/web/lib/editor.js @@ -1829,9 +1829,6 @@ } set(value) { - if(!this.id) { - return; - } try { window.localStorage.setItem(this.id, value); } catch(ignore) { @@ -1840,9 +1837,6 @@ } get() { - if(!this.id) { - return ''; - } try { return window.localStorage.getItem(this.id) || ''; } catch(e) { diff --git a/web/scripts/storage/LocalStorage.mjs b/web/scripts/storage/LocalStorage.mjs index e9ae11b..c2a2b37 100644 --- a/web/scripts/storage/LocalStorage.mjs +++ b/web/scripts/storage/LocalStorage.mjs @@ -4,9 +4,6 @@ export default class LocalStorage { } set(value) { - if(!this.id) { - return; - } try { window.localStorage.setItem(this.id, value); } catch(ignore) { @@ -15,9 +12,6 @@ export default class LocalStorage { } get() { - if(!this.id) { - return ''; - } try { return window.localStorage.getItem(this.id) || ''; } catch(e) {