handle cancelled username modal

This commit is contained in:
Eugene Pankov
2021-10-19 22:38:53 +02:00
parent 3621ea934c
commit 2fc457dd78

@@ -250,8 +250,12 @@ export class SSHSession extends BaseSession {
if (!this.authUsername) { if (!this.authUsername) {
const modal = this.ngbModal.open(PromptModalComponent) const modal = this.ngbModal.open(PromptModalComponent)
modal.componentInstance.prompt = `Username for ${this.profile.options.host}` modal.componentInstance.prompt = `Username for ${this.profile.options.host}`
const result = await modal.result try {
this.authUsername = result?.value ?? null const result = await modal.result
this.authUsername = result?.value ?? null
} catch {
this.authUsername = 'root'
}
} }
ssh.connect({ ssh.connect({