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

Stop note map simulation if not visible #4183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FliegendeWurst
Copy link
Contributor

Without this fix, Trilium will be sluggish for a while (usually less than a minute) after closing a large note map.

@@ -198,6 +198,10 @@ export default class RibbonContainer extends NoteContextAwareWidget {
}
}
} else {
const activeChild = this.getActiveRibbonWidget();
if (activeChild) {
activeChild.handleEvent('deactivated', {});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am using a new event here since I did not find any existing mechanism to shut down a widget.

Copy link
Owner

Choose a reason for hiding this comment

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

Have you tried cleanup() method in TypeWidget (inherited in NoteMapTypeWidget)? Seems to me it could be used for this. Although it would not work for Ribbon specifically ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't matter as much for the Ribbon widget, but could still be relevant for cases like #2608

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