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

Avoid initialising multiple times #625

Merged
merged 1 commit into from
Jan 21, 2022
Merged

Conversation

arthurattwell
Copy link
Member

We were setting the listener on the bookmarks icon multiple times by not exiting the mutationObserver loop when calling ebBookmarksInit(). This resolves that problem.

I noticed it on the EBT's plain-text samples chapter, where the bookmarks modal was opening and closing an odd number of extra times, meaning it appeared to not open at all.

@bertuss I seem to remember you spotted this or something like it when working on bookmark syncing recently? You may have fixed it another way in your work.

We were setting the listener on the bookmarks icon multiple times. This is a fix.
@netlify
Copy link

netlify bot commented Jan 18, 2022

✔️ Deploy Preview for electric-book ready!

🔨 Explore the source changes: ad154b5

🔍 Inspect the deploy log: https://app.netlify.com/sites/electric-book/deploys/61e7235741a1d50007486d7f

😎 Browse the preview: https://deploy-preview-625--electric-book.netlify.app/samples/text/01-10-questions

arthurattwell added a commit that referenced this pull request Jan 18, 2022
Copy link
Contributor

@bertuss bertuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arthurattwell arthurattwell merged commit 051ccdf into master Jan 21, 2022
@arthurattwell arthurattwell deleted the fix-bookmark-listener branch January 21, 2022 15:07
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.

2 participants