Skip to content

Commit

Permalink
Fix null check settings
Browse files Browse the repository at this point in the history
  • Loading branch information
newmanw committed Sep 13, 2024
1 parent dbd363b commit 2ad03ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web-app/src/app/setttings/settings.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HttpClient } from "@angular/common/http";
import { Injectable } from "@angular/core";
import { map, Observable } from "rxjs";
import { filter, map, Observable } from "rxjs";

interface Setting {
type: string
Expand All @@ -26,8 +26,9 @@ export class SettingsService {

getBanner(): Observable<Banners> {
return this.httpClient.get<Setting>('/api/settings/banner')
.pipe(filter<Setting>(Boolean))
.pipe(map((setting: Setting) => {
let banner = setting.settings as any
const banner = setting.settings as any
return {
header: banner.showHeader ? {
text: banner.headerText,
Expand Down

0 comments on commit 2ad03ae

Please sign in to comment.