From 5f584c1403f408e23cb065258f8888b09a86f396 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 9 Sep 2021 08:24:36 -0700 Subject: [PATCH] Lints for the Linter god --- bookwyrm/static/js/status_cache.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bookwyrm/static/js/status_cache.js b/bookwyrm/static/js/status_cache.js index 26b308ac..65583874 100644 --- a/bookwyrm/static/js/status_cache.js +++ b/bookwyrm/static/js/status_cache.js @@ -26,8 +26,10 @@ let StatusCache = new class { // Used in set reading goal let key = event.target.dataset.cacheDraft; let value = event.target.value; + if (!value) { window.localStorage.removeItem(key); + return; } @@ -44,6 +46,7 @@ let StatusCache = new class { // Used in set reading goal let key = node.dataset.cacheDraft; let value = window.localStorage.getItem(key); + if (!value) { return; } @@ -75,13 +78,15 @@ let StatusCache = new class { // Close modals let modal = form.closest(".modal.is-active"); - if (!!modal) { + + if (modal) { modal.getElementsByClassName("modal-close")[0].click(); } // Close reply panel let reply = form.closest(".reply-panel"); - if (!!reply) { + + if (reply) { document.querySelector("[data-controls=" + reply.id + "]").click(); }