mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
more refactorings
This commit is contained in:
@@ -180,9 +180,14 @@ class AppContext {
|
||||
return this.tabContexts;
|
||||
}
|
||||
|
||||
/** @returns {TabContext} */
|
||||
getTabContextById(tabId) {
|
||||
return this.tabContexts.find(tc => tc.tabId === tabId);
|
||||
}
|
||||
|
||||
/** @returns {TabContext} */
|
||||
getActiveTabContext() {
|
||||
return this.tabContexts.find(tc => tc.tabId === this.activeTabId);
|
||||
return this.getTabContextById(this.activeTabId);
|
||||
}
|
||||
|
||||
/** @returns {string|null} */
|
||||
@@ -253,14 +258,6 @@ class AppContext {
|
||||
}
|
||||
}
|
||||
|
||||
async refreshTabs(sourceTabId, noteId) {
|
||||
for (const tc of this.tabContexts) {
|
||||
if (tc.noteId === noteId && tc.tabId !== sourceTabId) {
|
||||
await this.reloadTab(tc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async reloadTab(tc) {
|
||||
if (tc.note) {
|
||||
noteDetailService.reloadNote(tc);
|
||||
|
||||
Reference in New Issue
Block a user