mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-08 05:20:01 +00:00
ref: a9c63b53059c842e31b52d1226aec78c6372fcc3 bad promise rejection handling
This commit is contained in:
parent
7687972e65
commit
49f9a10372
@ -18,7 +18,7 @@ export class CoreCommandProvider extends CommandProvider {
|
||||
}
|
||||
|
||||
async activate () {
|
||||
const profile = await this.profilesService.showProfileSelector()
|
||||
const profile = await this.profilesService.showProfileSelector().catch(() => null)
|
||||
if (profile) {
|
||||
this.profilesService.launchProfile(profile)
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ export default class AppModule { // eslint-disable-line @typescript-eslint/no-ex
|
||||
this.showSelector(provider)
|
||||
}
|
||||
if (hotkey === 'command-selector') {
|
||||
commands.showSelector()
|
||||
commands.showSelector().catch(() => {return})
|
||||
}
|
||||
|
||||
if (hotkey === 'profile-selector') {
|
||||
|
@ -101,7 +101,7 @@ export class CommandService {
|
||||
context.tab = tab.getFocusedTab() ?? undefined
|
||||
}
|
||||
const commands = await this.getCommands(context)
|
||||
await this.selector.show(
|
||||
return this.selector.show(
|
||||
this.translate.instant('Commands'),
|
||||
commands.map(c => ({
|
||||
name: c.label,
|
||||
@ -109,6 +109,6 @@ export class CommandService {
|
||||
description: c.sublabel,
|
||||
icon: c.icon,
|
||||
})),
|
||||
).catch(() => {return})
|
||||
).then(() => {return})
|
||||
}
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ export class ProfilesService {
|
||||
}
|
||||
})
|
||||
|
||||
await this.selector.show(this.translate.instant('Select profile or enter an address'), options).catch(() => resolve(null))
|
||||
await this.selector.show(this.translate.instant('Select profile or enter an address'), options).catch(() => reject())
|
||||
} catch (err) {
|
||||
reject(err)
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ export class ProfilesContextMenu extends TabContextMenuItemProvider {
|
||||
}
|
||||
|
||||
async switchTabProfile (tab: BaseTabComponent) {
|
||||
const profile = await this.profilesService.showProfileSelector()
|
||||
const profile = await this.profilesService.showProfileSelector().catch(() => null)
|
||||
if (!profile) {
|
||||
return
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user