From 52bbde40bd775f5fc749c2c165291b53b5abe95d Mon Sep 17 00:00:00 2001 From: liyunze <50455574+liyunze-coding@users.noreply.github.com> Date: Sun, 12 Nov 2023 13:36:12 +0800 Subject: [PATCH] Added local storage event listener --- configs.js | 2 +- scripts/taskList.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/configs.js b/configs.js index 03f2198..c5ed0ae 100644 --- a/configs.js +++ b/configs.js @@ -5,7 +5,7 @@ const configs = (function () { const enableLimit = false; // true or false const limit = 10; // integer - const modifyLocalStorage = true; // true or false + const modifyLocalStorage = false; // true or false const showOnlyStreamerTasks = false; // true or false // animation diff --git a/scripts/taskList.js b/scripts/taskList.js index 0ba1771..c937b54 100644 --- a/scripts/taskList.js +++ b/scripts/taskList.js @@ -978,6 +978,16 @@ function cancelAnimation() { // console.log("animation cancelled"); } +if (!settings.modifyLocalStorage) { + window.addEventListener( + "storage", + function () { + renderTaskListToDOM(); + }, + false + ); +} + (function () { setupDB(); importStyles();