mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-09 05:50:08 +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 () {
|
async activate () {
|
||||||
const profile = await this.profilesService.showProfileSelector()
|
const profile = await this.profilesService.showProfileSelector().catch(() => null)
|
||||||
if (profile) {
|
if (profile) {
|
||||||
this.profilesService.launchProfile(profile)
|
this.profilesService.launchProfile(profile)
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ export default class AppModule { // eslint-disable-line @typescript-eslint/no-ex
|
|||||||
this.showSelector(provider)
|
this.showSelector(provider)
|
||||||
}
|
}
|
||||||
if (hotkey === 'command-selector') {
|
if (hotkey === 'command-selector') {
|
||||||
commands.showSelector()
|
commands.showSelector().catch(() => {return})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hotkey === 'profile-selector') {
|
if (hotkey === 'profile-selector') {
|
||||||
|
@ -101,7 +101,7 @@ export class CommandService {
|
|||||||
context.tab = tab.getFocusedTab() ?? undefined
|
context.tab = tab.getFocusedTab() ?? undefined
|
||||||
}
|
}
|
||||||
const commands = await this.getCommands(context)
|
const commands = await this.getCommands(context)
|
||||||
await this.selector.show(
|
return this.selector.show(
|
||||||
this.translate.instant('Commands'),
|
this.translate.instant('Commands'),
|
||||||
commands.map(c => ({
|
commands.map(c => ({
|
||||||
name: c.label,
|
name: c.label,
|
||||||
@ -109,6 +109,6 @@ export class CommandService {
|
|||||||
description: c.sublabel,
|
description: c.sublabel,
|
||||||
icon: c.icon,
|
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) {
|
} catch (err) {
|
||||||
reject(err)
|
reject(err)
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,7 @@ export class ProfilesContextMenu extends TabContextMenuItemProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async switchTabProfile (tab: BaseTabComponent) {
|
async switchTabProfile (tab: BaseTabComponent) {
|
||||||
const profile = await this.profilesService.showProfileSelector()
|
const profile = await this.profilesService.showProfileSelector().catch(() => null)
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user