fix: avoid error Uncaught (in promise) on modal dismiss

This commit is contained in:
Clem Fern
2023-08-15 19:53:00 +02:00
parent d2752382aa
commit d21282501f
10 changed files with 39 additions and 37 deletions

View File

@@ -285,7 +285,7 @@ export class VaultFileProvider extends FileProvider {
icon: 'fas fa-file',
result: f,
})),
])
]).catch(() => null)
if (result) {
return `${this.prefix}${result.key.id}`
}

View File

@@ -149,7 +149,7 @@ export class CommonOptionsContextMenu extends TabContextMenuItemProvider {
click: async () => {
const modal = this.ngbModal.open(PromptModalComponent)
modal.componentInstance.prompt = this.translate.instant('Profile name')
const name = (await modal.result)?.value
const name = (await modal.result.catch(() => null))?.value
if (!name) {
return
}