mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 04:53:06 +00:00
Fixed notifications
This commit is contained in:
@@ -128,11 +128,18 @@ export class NotificationComponent implements OnInit, OnDestroy {
|
|||||||
if (item instanceof TemplateRef) {
|
if (item instanceof TemplateRef) {
|
||||||
this[key] = item;
|
this[key] = item;
|
||||||
} else if (key === 'title' || key === 'content') {
|
} else if (key === 'title' || key === 'content') {
|
||||||
this[key] = isNotEmpty(item) ?
|
let value = null;
|
||||||
typeof item === 'string' ?
|
if (typeof item === 'string') {
|
||||||
Observable.of(item)
|
value = Observable.of(item);
|
||||||
: typeof item === 'object' && isNotEmpty(item.payload) ? Observable.of(item.payload) : null
|
} else if (item instanceof Observable) {
|
||||||
: null;
|
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 {
|
} else {
|
||||||
this[key] = this.domSanitizer.bypassSecurityTrustHtml(item);
|
this[key] = this.domSanitizer.bypassSecurityTrustHtml(item);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user