Skip to content

Commit

Permalink
Catch user resolver error
Browse files Browse the repository at this point in the history
  • Loading branch information
newmanw committed Jul 2, 2024
1 parent bd3e536 commit 8679fa1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
6 changes: 4 additions & 2 deletions web-app/src/app/authentication/user.resolver.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from "@angular/core";
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from "@angular/router";
import { Observable } from "rxjs";
import { Observable, catchError, of } from "rxjs";
import { Api } from "../api/api.entity";
import { UserService } from "../user/user.service";

Expand All @@ -12,6 +12,8 @@ export class UserResolver implements Resolve<any> {
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
): Observable<Api> {
return this.service.getMyself()
return this.service.getMyself().pipe(
catchError(() => { return of(null); })
)
}
}
15 changes: 0 additions & 15 deletions web-app/src/app/user/profile/profile.component.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
// Custom Theming for Angular Material
@use '@angular/material' as mat;
@import "variables.scss";
@import '@mat-datetimepicker/core/datetimepicker/datetimepicker-theme.scss';

.error-theme {
$primary: mat.define-palette(mat.$red-palette);
$theme: mat.define-light-theme($primary, $primary, $primary);

@include mat.core-theme($theme);
@include mat.all-component-colors($theme);
@include mat.all-component-themes($theme);
@include mat.all-component-typographies($theme);
@include mat.all-component-themes($theme);
}

mat-form-field {
width: 100%;
margin-bottom: 8px;
Expand Down

0 comments on commit 8679fa1

Please sign in to comment.