night shift checks every interaction to respond to system changes

This commit is contained in:
dragonwocky 2020-09-30 14:43:23 +10:00
parent 8f1612e43c
commit a3e8758280
Signed by: dragonwocky
GPG Key ID: C7A48B7846AA706D
3 changed files with 5 additions and 3 deletions

View File

@ -14,6 +14,8 @@
- bugfix: remove shadow around light mode board headers - bugfix: remove shadow around light mode board headers
\+ minor text colour fixes for night shift theming. \+ minor text colour fixes for night shift theming.
- bugfix: properly detect/respond to `EACCES` errors. - 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) ### v0.9.1 (2020-09-26)

View File

@ -43,7 +43,7 @@ execute the following lines in the terminal:
``` ```
bash curl -sL https://deb.nodesource.com setup_current.x | sudo -E bash - bash curl -sL https://deb.nodesource.com setup_current.x | sudo -E bash -
sudo apt-get install -y nodejs sudo apt-get install -y nodejs
sudo npm i -g notion-enhancer npm i -g notion-enhancer
``` ```
**arch linux, manjaro** **arch linux, manjaro**

View File

@ -27,6 +27,7 @@ module.exports = {
const observer = new MutationObserver(process); const observer = new MutationObserver(process);
observer.observe(notion_elem, { observer.observe(notion_elem, {
attributes: true, attributes: true,
subtree: true,
}); });
function process(list, observer) { function process(list, observer) {
const mode = `notion-app-inner notion-${ const mode = `notion-app-inner notion-${
@ -34,8 +35,7 @@ module.exports = {
? 'dark' ? 'dark'
: 'light' : 'light'
}-theme`; }-theme`;
if (list[0].target.className !== mode) if (notion_elem.className !== mode) notion_elem.className = mode;
list[0].target.className = mode;
} }
} }
}); });