Skip to content
Snippets Groups Projects
Commit 2e443519 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FIX #21979 TIME 0:30 loop fortify start when not started

(cherry picked from commit ced9a7c9)
parent b8c85799
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,8 @@ export class SignatureMethodModalComponent implements OnInit, OnDestroy { ...@@ -81,7 +81,8 @@ export class SignatureMethodModalComponent implements OnInit, OnDestroy {
async initFortify() { async initFortify() {
this.api = new FortifyAPI(null); this.api = new FortifyAPI(null);
await this.api.start(); await this.waitFortifyStart();
const challenge = await this.api.challenge(); const challenge = await this.api.challenge();
if (challenge) { if (challenge) {
...@@ -93,6 +94,25 @@ export class SignatureMethodModalComponent implements OnInit, OnDestroy { ...@@ -93,6 +94,25 @@ export class SignatureMethodModalComponent implements OnInit, OnDestroy {
.on('remove', (event: any) => this.updateProvider(event)); .on('remove', (event: any) => this.updateProvider(event));
} }
async waitFortifyStart() {
let fortifyState: boolean = false;
while (!fortifyState) {
fortifyState = await this.fortifyStart();
await new Promise(resolve => setTimeout(resolve, 1000));
}
}
fortifyStart(): Promise<boolean> {
return new Promise(async (resolve) => {
try {
await this.api.start();
resolve(true);
} catch (error) {
resolve(false);
}
});
}
async certificateChosen(certData: any) { async certificateChosen(certData: any) {
this.loadingController.create({ this.loadingController.create({
message: this.translate.instant('lang.processing'), message: this.translate.instant('lang.processing'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment