Skip to content

Commit 6952e51

Browse files
committed
fix: 🐛 can't move a tab to new window
1 parent f67da58 commit 6952e51

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/public/app/components/tab_manager.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -393,17 +393,17 @@ export default class TabManager extends Component {
393393
this.setCurrentNavigationStateToHash();
394394
}
395395

396-
async removeNoteContext(ntxId: string | null) {
396+
async removeNoteContext(ntxId: string | null): Promise<boolean> {
397397
// removing note context is an async process which can take some time, if users presses CTRL-W quickly, two
398398
// close events could interleave which would then lead to attempting to activate already removed context.
399-
return await this.mutex.runExclusively(async () => {
399+
return await this.mutex.runExclusively(async (): Promise<boolean> => {
400400
let noteContextToRemove;
401401

402402
try {
403403
noteContextToRemove = this.getNoteContextById(ntxId);
404404
} catch {
405405
// note context not found
406-
return;
406+
return false;
407407
}
408408

409409
if (noteContextToRemove.isMainContext()) {
@@ -413,7 +413,7 @@ export default class TabManager extends Component {
413413
if (noteContextToRemove.isEmpty()) {
414414
// this is already the empty note context, no point in closing it and replacing with another
415415
// empty tab
416-
return;
416+
return false;
417417
}
418418

419419
await this.openEmptyTab();
@@ -451,6 +451,7 @@ export default class TabManager extends Component {
451451
}
452452

453453
this.removeNoteContexts(noteContextsToRemove);
454+
return true;
454455
});
455456
}
456457

0 commit comments

Comments
 (0)