mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1239: #3093 ISA Offline Message Fix
#3093 ISA Offline Message Fix#3093 ISA Offline Message Fix
This commit is contained in:
committed by
Andreas Schickinger
parent
cd5599ff1c
commit
6b00c2c81a
@@ -1,3 +1,4 @@
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { ErrorHandler, Injectable } from '@angular/core';
|
||||
import { AuthService } from '@core/auth';
|
||||
import { UiErrorModalComponent, UiModalService } from '@ui/modal';
|
||||
@@ -15,6 +16,13 @@ export class IsaErrorHandler implements ErrorHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
this._modal.open({ content: UiErrorModalComponent, title: 'Unbekannter Fehler', data: error });
|
||||
this._modal.open({
|
||||
content: UiErrorModalComponent,
|
||||
title:
|
||||
!navigator.onLine || (error instanceof HttpErrorResponse && error?.status === 0)
|
||||
? 'Sie sind offline, keine Verbindung zum Netzwerk'
|
||||
: 'Unbekannter Fehler',
|
||||
data: error,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,9 @@ import { UiModalRef } from '../defs';
|
||||
})
|
||||
export class UiErrorModalComponent implements OnInit {
|
||||
get errorMessage() {
|
||||
if (!navigator.onLine) {
|
||||
if (!navigator.onLine || (this.error instanceof HttpErrorResponse && this.error?.status === 0)) {
|
||||
return this.getOfflineMessage();
|
||||
}
|
||||
|
||||
if (this.error instanceof HttpErrorResponse) {
|
||||
if (isResponseArgs(this.error?.error)) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user