This commit is contained in:
zadam
2020-02-09 22:31:52 +01:00
parent 99ea238c3f
commit 7767edd82f
7 changed files with 25 additions and 24 deletions

View File

@@ -100,15 +100,19 @@ class TabContext extends Component {
}
}
noteDeletedListener({noteId}) {
if (this.noteId === noteId) {
this.noteId = null;
this.notePath = null;
async entitiesReloadedListener({loadResults}) {
if (loadResults.isNoteReloaded(this.noteId)) {
const note = await treeCache.getNote(this.noteId);
this.trigger('tabNoteSwitched', {
tabId: this.tabId,
notePath: this.notePath
});
if (note.isDeleted) {
this.noteId = null;
this.notePath = null;
this.trigger('tabNoteSwitched', {
tabId: this.tabId,
notePath: this.notePath
});
}
}
}
}