Leere Notifications nicht anzeigen

This commit is contained in:
Lorenz Hilpert
2023-07-14 14:50:08 +02:00
parent 4fe5034e1c
commit ac35cc237e

View File

@@ -48,7 +48,19 @@ export class NotificationsHub extends SignalrHub {
this.messageBoardItems$.next(current);
}
notifications$ = this.messageBoardItems$.asObservable();
notifications$ = this.messageBoardItems$.asObservable().pipe(
map((data) => {
const messages = { ...data };
const keys = Object.keys(data);
for (let key of keys) {
if (data[key].length === 0 || data[key] === undefined) {
delete messages[key];
}
}
return messages;
})
);
// notifications$ = merge(
// of(this._getNotifications()).pipe(filter((f) => !!f)),