Use api action directive for confirm action (#1153)

This commit is contained in:
Matt Gibson 2021-09-13 08:46:16 -04:00 committed by GitHub
parent 8180aaa4cc
commit c82d1b3c50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -253,11 +253,10 @@ export abstract class BasePeopleComponent<UserType extends ProviderUserUserDetai
comp.publicKey = publicKey; comp.publicKey = publicKey;
comp.onConfirmedUser.subscribe(async () => { comp.onConfirmedUser.subscribe(async () => {
try { try {
await confirmUser(publicKey); comp.formPromise = confirmUser(publicKey);
await comp.formPromise;
modal.close(); modal.close();
} catch (e) { } catch { }
this.logService.error(`Handled exception: ${e}`);
}
}); });
}); });
return; return;

View File

@ -1,6 +1,6 @@
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="confirmUserTitle"> <div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="confirmUserTitle">
<div class="modal-dialog modal-dialog-scrollable" role="document"> <div class="modal-dialog modal-dialog-scrollable" role="document">
<form class="modal-content" #form (ngSubmit)="submit()"> <form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise">
<div class="modal-header"> <div class="modal-header">
<h2 class="modal-title" id="confirmUserTitle"> <h2 class="modal-title" id="confirmUserTitle">
{{'confirmUser' | i18n}} {{'confirmUser' | i18n}}

View File

@ -24,6 +24,7 @@ export class UserConfirmComponent implements OnInit {
dontAskAgain = false; dontAskAgain = false;
loading = true; loading = true;
fingerprint: string; fingerprint: string;
formPromise: Promise<any>;
constructor(private cryptoService: CryptoService, private storageService: StorageService) { } constructor(private cryptoService: CryptoService, private storageService: StorageService) { }