diff --git a/src/frontend/app/service/signature-method/signature-method-modal.component.ts b/src/frontend/app/service/signature-method/signature-method-modal.component.ts index 3c807f923296920a58bc7da6b1065b04f309a6a7..ae468670417e04feae71fe3eb8f9e8137cc0714e 100644 --- a/src/frontend/app/service/signature-method/signature-method-modal.component.ts +++ b/src/frontend/app/service/signature-method/signature-method-modal.component.ts @@ -1,4 +1,4 @@ -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);