mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 07:45:51 +01:00
10x speed-up of event propagation
This commit is contained in:
@@ -186,9 +186,13 @@ export default class RibbonContainer extends NoteContextAwareWidget {
|
||||
const activeChild = this.getActiveRibbonWidget();
|
||||
|
||||
if (activeChild && (refreshActiveTab || !wasAlreadyActive)) {
|
||||
activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath}).then(() => {
|
||||
const handleEventPromise = activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath});
|
||||
|
||||
if (handleEventPromise) {
|
||||
handleEventPromise.then(() => activeChild.focus?.());
|
||||
} else {
|
||||
activeChild.focus?.();
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.lastActiveComponentId = null;
|
||||
|
||||
Reference in New Issue
Block a user