mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 23:35:50 +01:00
event fixes
This commit is contained in:
@@ -46,9 +46,9 @@ export default class TabAwareWidget extends BasicWidget {
|
||||
|
||||
async refreshWithNote(note, notePath) {}
|
||||
|
||||
async tabNoteSwitchedEvent({tabId, notePath}) {
|
||||
async tabNoteSwitchedEvent({tabContext, notePath}) {
|
||||
// if notePath does not match then the tabContext has been switched to another note in the mean time
|
||||
if (this.notePath === notePath) {
|
||||
if (tabContext.notePath === notePath) {
|
||||
await this.noteSwitched();
|
||||
}
|
||||
}
|
||||
@@ -57,8 +57,8 @@ export default class TabAwareWidget extends BasicWidget {
|
||||
await this.refresh();
|
||||
}
|
||||
|
||||
async activeTabChangedEvent({tabId}) {
|
||||
this.tabContext = appContext.tabManager.getTabContextById(tabId);
|
||||
async activeTabChangedEvent({tabContext}) {
|
||||
this.tabContext = tabContext;
|
||||
|
||||
await this.activeTabChanged();
|
||||
}
|
||||
@@ -68,8 +68,8 @@ export default class TabAwareWidget extends BasicWidget {
|
||||
}
|
||||
|
||||
// when note is both switched and activated, this should not produce double refresh
|
||||
async tabNoteSwitchedAndActivatedEvent({tabId, notePath}) {
|
||||
this.tabContext = appContext.tabManager.getTabContextById(tabId);
|
||||
async tabNoteSwitchedAndActivatedEvent({tabContext, notePath}) {
|
||||
this.tabContext = tabContext;
|
||||
|
||||
// if notePath does not match then the tabContext has been switched to another note in the mean time
|
||||
if (this.notePath === notePath) {
|
||||
@@ -84,11 +84,6 @@ export default class TabAwareWidget extends BasicWidget {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
async newTabOpenedEvent({tabContext}) {
|
||||
/** @var {TabContext} */
|
||||
this.tabContext = tabContext;
|
||||
}
|
||||
|
||||
async noteTypeMimeChangedEvent({noteId}) {
|
||||
if (this.isNote(noteId)) {
|
||||
await this.refresh();
|
||||
|
||||
Reference in New Issue
Block a user