mirror of
https://github.com/discourse/discourse.git
synced 2026-08-12 05:55:39 -05:00
DEV: Minor code cleanup (#18225)
Various small changes made while debugging MessageBus-related tests.
This commit is contained in:
@@ -31,15 +31,15 @@ function initializePolls(api) {
|
||||
|
||||
api.modifyClass("controller:topic", {
|
||||
pluginId: PLUGIN_ID,
|
||||
|
||||
subscribe() {
|
||||
this._super(...arguments);
|
||||
this.messageBus.subscribe("/polls/" + this.get("model.id"), (msg) => {
|
||||
this.messageBus.subscribe(`/polls/${this.model.id}`, (msg) => {
|
||||
const post = this.get("model.postStream").findLoadedPost(msg.post_id);
|
||||
if (post) {
|
||||
post.set("polls", msg.polls);
|
||||
}
|
||||
post?.set("polls", msg.polls);
|
||||
});
|
||||
},
|
||||
|
||||
unsubscribe() {
|
||||
this.messageBus.unsubscribe("/polls/*");
|
||||
this._super(...arguments);
|
||||
|
||||
Reference in New Issue
Block a user