mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
fixes to note loading. Sidebar flickers way less after note change
This commit is contained in:
@@ -374,20 +374,11 @@ tabRow.addListener('activeTabChange', async ({ detail }) => {
|
||||
tabRow.addListener('tabRemove', async ({ detail }) => {
|
||||
const tabId = detail.tabEl.getAttribute('data-tab-id');
|
||||
|
||||
const tabContextToDelete = tabContexts.find(nc => nc.tabId === tabId);
|
||||
|
||||
if (tabContextToDelete) {
|
||||
// sometimes there are orphan autocompletes after closing the tab
|
||||
tabContextToDelete.closeAutocomplete();
|
||||
|
||||
await tabContextToDelete.saveNoteIfChanged();
|
||||
tabContextToDelete.$tabContent.remove();
|
||||
}
|
||||
tabContexts.filter(nc => nc.tabId === tabId)
|
||||
.forEach(tc => tc.remove());
|
||||
|
||||
tabContexts = tabContexts.filter(nc => nc.tabId !== tabId);
|
||||
|
||||
console.log(`Removed tab ${tabId}`);
|
||||
|
||||
if (tabContexts.length === 0) {
|
||||
openEmptyTab();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user