diff --git a/frontend/src/app/component/einstellungen/editieren/editieren.component.ts b/frontend/src/app/component/einstellungen/editieren/editieren.component.ts index 358064a..a62950e 100644 --- a/frontend/src/app/component/einstellungen/editieren/editieren.component.ts +++ b/frontend/src/app/component/einstellungen/editieren/editieren.component.ts @@ -35,7 +35,7 @@ export class EditierenComponent implements OnInit { private http: HttpClient, private _snackbar: MatSnackBar, private _logger: NGXLogger, - ) { + private _dialog: MatDialog) { this.route.paramMap.subscribe(paramMap => { this.id = paramMap.get('id'); if (this.id) { @@ -69,7 +69,10 @@ export class EditierenComponent implements OnInit { match_all_keywords: data.match_all_keywords }); }, - err => this._logger.error(err), + err => { + this.errorDialog(); + this._logger.error(err); + } ); } @@ -90,6 +93,7 @@ export class EditierenComponent implements OnInit { this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000}); }, err => { + this.errorDialog(); this._logger.error(err); return throwError(err); } @@ -100,10 +104,24 @@ export class EditierenComponent implements OnInit { this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000}); }, err => { + this.errorDialog(); this._logger.error(err); return throwError(err); } ); } } + + + public errorDialog() { + const dialogRef = this._dialog.open(DialogComponent, { + data: { + title: 'Serverfehler', + body: 'Fehler beim Aufruf des Servers', + abort: 'Abbrechen', + confirm: 'OK', + hideAbort: true + } + }); + } } diff --git a/frontend/src/app/component/einstellungen/einstellungen.component.ts b/frontend/src/app/component/einstellungen/einstellungen.component.ts index e1a08a5..d71ac6f 100644 --- a/frontend/src/app/component/einstellungen/einstellungen.component.ts +++ b/frontend/src/app/component/einstellungen/einstellungen.component.ts @@ -66,4 +66,17 @@ export class EinstellungenComponent implements OnInit { } ); } + + + public errorDialog() { + const dialogRef = this._dialog.open(DialogComponent, { + data: { + title: 'Serverfehler', + body: 'Fehler beim Aufruf des Servers', + abort: 'Abbrechen', + confirm: 'OK', + hideAbort: true + } + }); + } }