mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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 || {}));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user