Skip to content
Snippets Groups Projects
Commit 5045b810 authored by Giuseppe Digilio's avatar Giuseppe Digilio
Browse files

Fixed notifications

parent d3949c17
Branches
Tags
No related merge requests found
......@@ -129,15 +129,17 @@ export class NotificationComponent implements OnInit, OnDestroy {
this[key] = item;
} else if (key === 'title' || key === 'content') {
let value = null;
if (typeof item === 'string') {
value = Observable.of(item);
} else if (item instanceof Observable) {
value = item;
} else if (typeof item === 'object' && isNotEmpty(item.value)) {
// when notifications state is transferred from SSR to CSR,
// Observables Object loses the instance type and become simply object,
// so converts it again to Observable
value = Observable.of(item.value);
if (isNotEmpty(item)) {
if (typeof item === 'string') {
value = Observable.of(item);
} else if (item instanceof Observable) {
value = item;
} else if (typeof item === 'object' && isNotEmpty(item.value)) {
// when notifications state is transferred from SSR to CSR,
// Observables Object loses the instance type and become simply object,
// so converts it again to Observable
value = Observable.of(item.value);
}
}
this[key] = value
} else {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment