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

Bug - When the sidebar updates, hooks are established more than once #49

Open
earlSt1 opened this issue Nov 6, 2022 · 0 comments
Open

Comments

@earlSt1
Copy link

earlSt1 commented Nov 6, 2022

Hi, just noticed this while working on Compendium Folders. When the sidebar updates, a callback is created on the renderCompendiumDirectory hook, which references the same function. What this means is that every time the sidebar updates, the number of hooks that compendium browser has established double until the sidebar becomes unresponsive.

I'm currently on v10b288, using D&D5e v2.0.3 and Compendium Browser v0.8.1 (latest i could download from the module install list).

For reference, I think the bit of problematic code is here:

hookCompendiumList() {
Hooks.on('renderCompendiumDirectory', (app, html, data) => {
this.hookCompendiumList();
});

Edit - Thought i was experiencing deja-vu, then i realised I raised this issue in the parent repo 😄

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

No branches or pull requests

1 participant