From a3e8758280908bd1db430e397dcd74488692ad6b 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 --- CHANGELOG.md | 2 ++ README.md | 2 +- mods/night-shift/mod.js | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d59057e..c11166c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ - bugfix: remove shadow around light mode board headers \+ minor text colour fixes for night shift theming. - bugfix: properly detect/respond to `EACCES` errors. +- bugfix: night shift checks every interaction, + will respond to system changes without any manual changes. ### v0.9.1 (2020-09-26) diff --git a/README.md b/README.md index 8a749d2..fdac56c 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ execute the following lines in the terminal: ``` bash curl -sL https://deb.nodesource.com setup_current.x | sudo -E bash - sudo apt-get install -y nodejs -sudo npm i -g notion-enhancer +npm i -g notion-enhancer ``` **arch linux, manjaro** diff --git a/mods/night-shift/mod.js b/mods/night-shift/mod.js index 51d5702..8014918 100644 --- a/mods/night-shift/mod.js +++ b/mods/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; } } });