cic-staff-client/src/app/_services/error-dialog.service.ts
Spencer Ofwiti 8c2b659360 Bug fix.
- Handle error for incorrect passphrase entry.
2021-03-21 19:27:54 +03:00

28 lines
644 B
TypeScript

import { Injectable } from '@angular/core';
import {MatDialog} from '@angular/material/dialog';
import {ErrorDialogComponent} from '@app/shared/error-dialog/error-dialog.component';
@Injectable({
providedIn: 'root'
})
export class ErrorDialogService {
public isDialogOpen: boolean = false;
constructor(
public dialog: MatDialog,
) { }
openDialog(data): any {
if (this.isDialogOpen) {
return false;
}
this.isDialogOpen = true;
const dialogRef = this.dialog.open(ErrorDialogComponent, {
width: '300px',
data
});
dialogRef.afterClosed().subscribe(() => this.isDialogOpen = false);
}
}