FIX: when banner is removed update all clients
Previously removing a banner raised a null "banner" in the message bus channel. Then Ember.Object.create would fail cause it always expects an object in constructor.
This commit is contained in:
parent
bac1bcc79f
commit
88f8c9f43e
|
@ -5,7 +5,7 @@ export default {
|
|||
after: "message-bus",
|
||||
|
||||
initialize(container) {
|
||||
const banner = Ember.Object.create(PreloadStore.get("banner")),
|
||||
const banner = Ember.Object.create(PreloadStore.get("banner") || {}),
|
||||
site = container.lookup("site:main");
|
||||
|
||||
site.set("banner", banner);
|
||||
|
@ -16,7 +16,7 @@ export default {
|
|||
}
|
||||
|
||||
messageBus.subscribe("/site/banner", function(ban) {
|
||||
site.set("banner", Ember.Object.create(ban));
|
||||
site.set("banner", Ember.Object.create(ban || {}));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue