mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
Deprecates global use of Discourse.MessageBus
We can use DI for this, which makes it easier for plugins to subscribe to the message bus.
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
import showModal from 'discourse/lib/show-modal';
|
||||
|
||||
const LOG_CHANNEL = "/admin/backups/logs";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
|
||||
LOG_CHANNEL: "/admin/backups/logs",
|
||||
|
||||
activate() {
|
||||
Discourse.MessageBus.subscribe(this.LOG_CHANNEL, this._processLogMessage.bind(this));
|
||||
this.messageBus.subscribe(LOG_CHANNEL, this._processLogMessage.bind(this));
|
||||
},
|
||||
|
||||
_processLogMessage(log) {
|
||||
@ -40,7 +40,7 @@ export default Discourse.Route.extend({
|
||||
},
|
||||
|
||||
deactivate() {
|
||||
Discourse.MessageBus.unsubscribe(this.LOG_CHANNEL);
|
||||
this.messageBus.unsubscribe(LOG_CHANNEL);
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
Reference in New Issue
Block a user