|
|
|
|
@ -550,10 +550,8 @@ export default class TabManager extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async closeActiveTabCommand() {
|
|
|
|
|
if (this.activeNtxId) {
|
|
|
|
|
await this.removeNoteContext(this.activeNtxId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
beforeUnloadEvent(): boolean {
|
|
|
|
|
this.tabsUpdate.updateNowIfNecessary();
|
|
|
|
|
@ -566,15 +564,13 @@ export default class TabManager extends Component {
|
|
|
|
|
|
|
|
|
|
async closeAllTabsCommand() {
|
|
|
|
|
for (const ntxIdToRemove of this.mainNoteContexts.map((nc) => nc.ntxId)) {
|
|
|
|
|
if (ntxIdToRemove) {
|
|
|
|
|
await this.removeNoteContext(ntxIdToRemove);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async closeOtherTabsCommand({ ntxId }: { ntxId: string }) {
|
|
|
|
|
for (const ntxIdToRemove of this.mainNoteContexts.map((nc) => nc.ntxId)) {
|
|
|
|
|
if (ntxIdToRemove && ntxIdToRemove !== ntxId) {
|
|
|
|
|
if (ntxIdToRemove !== ntxId) {
|
|
|
|
|
await this.removeNoteContext(ntxIdToRemove);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -587,12 +583,10 @@ export default class TabManager extends Component {
|
|
|
|
|
if (index !== -1) {
|
|
|
|
|
const idsToRemove = ntxIds.slice(index + 1);
|
|
|
|
|
for (const ntxIdToRemove of idsToRemove) {
|
|
|
|
|
if (ntxIdToRemove) {
|
|
|
|
|
await this.removeNoteContext(ntxIdToRemove);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async closeTabCommand({ ntxId }: { ntxId: string }) {
|
|
|
|
|
await this.removeNoteContext(ntxId);
|
|
|
|
|
|