Skip to content
Snippets Groups Projects
Commit df4392e0 authored by Jean-Laurent DUZANT's avatar Jean-Laurent DUZANT
Browse files

FIX #21979 TIME 0 add finish fortify api when component is destroyed

parent cf84e69f
No related branches found
No related tags found
No related merge requests found
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, OnDestroy } from '@angular/core';
import { LoadingController, ModalController } from '@ionic/angular';
import { catchError, tap } from 'rxjs/operators';
import { of } from 'rxjs';
......@@ -17,7 +17,7 @@ import { FortifyAPI } from '@peculiar/fortify-client-core';
templateUrl: 'signature-method-modal.component.html',
styleUrls: ['./signature-method-modal.component.scss']
})
export class SignatureMethodModalComponent implements OnInit {
export class SignatureMethodModalComponent implements OnInit, OnDestroy {
@Input() note: string;
@Input() signatureMode: string;
......@@ -71,6 +71,13 @@ export class SignatureMethodModalComponent implements OnInit {
await this.initFortify();
}
async ngOnDestroy(): Promise<void> {
if (!this.functionsService.empty(this.api)) {
this.api.finish();
this.api = null;
}
}
async initFortify() {
this.api = new FortifyAPI(null);
......
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