File tree 1 file changed +5
-4
lines changed
src/public/app/components
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -393,17 +393,17 @@ export default class TabManager extends Component {
393
393
this . setCurrentNavigationStateToHash ( ) ;
394
394
}
395
395
396
- async removeNoteContext ( ntxId : string | null ) {
396
+ async removeNoteContext ( ntxId : string | null ) : Promise < boolean > {
397
397
// removing note context is an async process which can take some time, if users presses CTRL-W quickly, two
398
398
// 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 > => {
400
400
let noteContextToRemove ;
401
401
402
402
try {
403
403
noteContextToRemove = this . getNoteContextById ( ntxId ) ;
404
404
} catch {
405
405
// note context not found
406
- return ;
406
+ return false ;
407
407
}
408
408
409
409
if ( noteContextToRemove . isMainContext ( ) ) {
@@ -413,7 +413,7 @@ export default class TabManager extends Component {
413
413
if ( noteContextToRemove . isEmpty ( ) ) {
414
414
// this is already the empty note context, no point in closing it and replacing with another
415
415
// empty tab
416
- return ;
416
+ return false ;
417
417
}
418
418
419
419
await this . openEmptyTab ( ) ;
@@ -451,6 +451,7 @@ export default class TabManager extends Component {
451
451
}
452
452
453
453
this . removeNoteContexts ( noteContextsToRemove ) ;
454
+ return true ;
454
455
} ) ;
455
456
}
456
457
You can’t perform that action at this time.
0 commit comments