event fixes

This commit is contained in:
zadam
2020-03-07 13:40:46 +01:00
parent 091eb8f791
commit 8909d175d0
5 changed files with 25 additions and 47 deletions

View File

@@ -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();