mirror of
https://github.com/zadam/trilium.git
synced 2025-11-04 20:36:13 +01:00
fix import
This commit is contained in:
@@ -304,9 +304,15 @@ export default class TabManager extends Component {
|
||||
await this.triggerEvent('beforeTabRemove', { ntxIds: ntxIdsToRemove });
|
||||
|
||||
if (!noteContextToRemove.isMainContext()) {
|
||||
await this.activateNoteContext(noteContextToRemove.getMainContext().ntxId);
|
||||
const ntxId1 = noteContextToRemove.getMainContext().ntxId;
|
||||
|
||||
console.log(`Isn't main context, will try to activate ${ntxId1}`);
|
||||
|
||||
await this.activateNoteContext(ntxId1);
|
||||
}
|
||||
else if (this.mainNoteContexts.length <= 1) {
|
||||
console.log("No main context remaining, opening new one");
|
||||
|
||||
await this.openAndActivateEmptyTab();
|
||||
}
|
||||
else if (ntxIdsToRemove.includes(this.activeNtxId)) {
|
||||
@@ -358,16 +364,20 @@ export default class TabManager extends Component {
|
||||
|
||||
async activateNextTabCommand() {
|
||||
const oldIdx = this.mainNoteContexts.findIndex(nc => nc.ntxId === this.activeNtxId);
|
||||
const newActiveTabId = this.mainNoteContexts[oldIdx === this.noteContexts.length - 1 ? 0 : oldIdx + 1].ntxId;
|
||||
const newActiveNtxId = this.mainNoteContexts[oldIdx === this.noteContexts.length - 1 ? 0 : oldIdx + 1].ntxId;
|
||||
|
||||
await this.activateNoteContext(newActiveTabId);
|
||||
console.log(`Activating next one ${newActiveNtxId}`);
|
||||
|
||||
await this.activateNoteContext(newActiveNtxId);
|
||||
}
|
||||
|
||||
async activatePreviousTabCommand() {
|
||||
const oldIdx = this.mainNoteContexts.findIndex(nc => nc.ntxId === this.activeNtxId);
|
||||
const newActiveTabId = this.mainNoteContexts[oldIdx === 0 ? this.noteContexts.length - 1 : oldIdx - 1].ntxId;
|
||||
const newActiveNtxId = this.mainNoteContexts[oldIdx === 0 ? this.noteContexts.length - 1 : oldIdx - 1].ntxId;
|
||||
|
||||
await this.activateNoteContext(newActiveTabId);
|
||||
console.log(`Activating previous one ${newActiveNtxId}`);
|
||||
|
||||
await this.activateNoteContext(newActiveNtxId);
|
||||
}
|
||||
|
||||
async closeActiveTabCommand() {
|
||||
|
||||
Reference in New Issue
Block a user