Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix high CPU usage and alignment for emoji-sets #33

Merged
merged 1 commit into from Sep 21, 2021

Conversation

Arecsu
Copy link
Contributor

@Arecsu Arecsu commented Sep 21, 2021

MutationObserver enters into an infinite loop by iterating on itself. By disconnecting the observer and reconnecting it after parsing the DOM for emoji-sets to work, we stop the problem and Notion goes back to sane 0% CPU idle usage.

Custom emojis, when displayed as icons in every page and in the left sidebar of Notion, are a bit misaligned. This is not the case for the emojis in the page content. Just specific places when they act like icons. This fixes it and it looks awesome. Precisely aligned as the default emoji set.

MutationObserver enters into an infinite loop by iterating on itself. By disconnecting the observer and reconnecting it after parsing the DOM for emoji-sets to work, we stop the problem and Notion goes back to sane 0% CPU idle usage.

Custom emojis, when displayed as icons in every page and in the left sidebar of Notion, are a bit misaligned. This is not the case for the emojis in the page content. Just specific places when they act like icons. This fixes it and it looks awesome. Precisely aligned as the default emoji set.
@jamezrin
Copy link
Member

Thanks for contributing, I tested it and it works, merging!

@jamezrin jamezrin merged commit 31c5f67 into notion-enhancer:main Sep 21, 2021
@Arecsu Arecsu deleted the patch-1 branch September 21, 2021 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants