Skip to content

Commit

Permalink
fix(selector): avoid error Uncaught (in promise) on modal dismiss (fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Clem-Fern committed Aug 15, 2023
1 parent d212825 commit a9c63b5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tabby-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export default class AppModule { // eslint-disable-line @typescript-eslint/no-ex
})
}

await this.selector.show(this.translate.instant('Select profile'), options)
await this.selector.show(this.translate.instant('Select profile'), options).catch(() => {return})
}

static forRoot (): ModuleWithProviders<AppModule> {
Expand Down
2 changes: 1 addition & 1 deletion tabby-core/src/services/commands.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ export class CommandService {
description: c.sublabel,
icon: c.icon,
})),
)
).catch(() => {return})
}
}
5 changes: 3 additions & 2 deletions tabby-core/src/services/fileProviders.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ export class FileProvidersService {
) { }

async selectAndStoreFile (description: string): Promise<string> {
const p = await this.selectProvider()
return p.selectAndStoreFile(description)
return this.selectProvider().then(p => {
return p.selectAndStoreFile(description)
})
}

async retrieveFile (key: string): Promise<Buffer> {
Expand Down
2 changes: 1 addition & 1 deletion tabby-core/src/services/profiles.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ export class ProfilesService {
}
})

await this.selector.show(this.translate.instant('Select profile or enter an address'), options)
await this.selector.show(this.translate.instant('Select profile or enter an address'), options).catch(() => resolve(null))
} catch (err) {
reject(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
name: p.group ? `${this.profilesService.resolveProfileGroupName(p.group)} / ${p.name}` : p.name,
result: p,
})),
)
).catch(() => undefined)
if (!base) {
return
}
}
const profile: PartialProfile<Profile> = deepClone(base)
delete profile.id
Expand Down

0 comments on commit a9c63b5

Please sign in to comment.