From cacb6554c7f3f7514757e17cfdc0591b73dd421a Mon Sep 17 00:00:00 2001 From: dragonwocky Date: Wed, 30 Sep 2020 14:43:23 +1000 Subject: [PATCH] night shift checks every interaction to respond to system changes --- repo/night-shift/mod.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repo/night-shift/mod.js b/repo/night-shift/mod.js index 51d5702..8014918 100644 --- a/repo/night-shift/mod.js +++ b/repo/night-shift/mod.js @@ -27,6 +27,7 @@ module.exports = { const observer = new MutationObserver(process); observer.observe(notion_elem, { attributes: true, + subtree: true, }); function process(list, observer) { const mode = `notion-app-inner notion-${ @@ -34,8 +35,7 @@ module.exports = { ? 'dark' : 'light' }-theme`; - if (list[0].target.className !== mode) - list[0].target.className = mode; + if (notion_elem.className !== mode) notion_elem.className = mode; } } });