mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
Revert Ember.run refactors
This reverts commit 5ca60fcb6b592524086f98279d3e4fd949598343.
This commit is contained in:
@ -1,6 +1,3 @@
|
||||
import { once } from "@ember/runloop";
|
||||
import { debounce } from "@ember/runloop";
|
||||
import { cancel } from "@ember/runloop";
|
||||
import Component from "@ember/component";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import {
|
||||
@ -29,12 +26,12 @@ export default Component.extend({
|
||||
@on("didInsertElement")
|
||||
composerOpened() {
|
||||
this._lastPublish = new Date();
|
||||
once(this, "updateState");
|
||||
Ember.run.once(this, "updateState");
|
||||
},
|
||||
|
||||
@observes("action", "post.id", "topic.id")
|
||||
composerStateChanged() {
|
||||
once(this, "updateState");
|
||||
Ember.run.once(this, "updateState");
|
||||
},
|
||||
|
||||
@observes("reply", "title")
|
||||
@ -47,8 +44,8 @@ export default Component.extend({
|
||||
@on("willDestroyElement")
|
||||
composerClosing() {
|
||||
this.publish({ previous: this.currentState });
|
||||
cancel(this._pingTimer);
|
||||
cancel(this._clearTimer);
|
||||
Ember.run.cancel(this._pingTimer);
|
||||
Ember.run.cancel(this._clearTimer);
|
||||
},
|
||||
|
||||
updateState() {
|
||||
@ -97,7 +94,7 @@ export default Component.extend({
|
||||
r.messagebus_channel,
|
||||
message => {
|
||||
if (!this.isDestroyed) this.set("presenceUsers", message.users);
|
||||
this._clearTimer = debounce(
|
||||
this._clearTimer = Ember.run.debounce(
|
||||
this,
|
||||
"clear",
|
||||
keepAliveDuration + bufferTime
|
||||
|
@ -1,5 +1,3 @@
|
||||
import { debounce } from "@ember/runloop";
|
||||
import { cancel } from "@ember/runloop";
|
||||
import Component from "@ember/component";
|
||||
import {
|
||||
default as computed,
|
||||
@ -28,7 +26,7 @@ export default Component.extend({
|
||||
this.channel,
|
||||
message => {
|
||||
if (!this.isDestroyed) this.set("presenceUsers", message.users);
|
||||
this._clearTimer = debounce(
|
||||
this._clearTimer = Ember.run.debounce(
|
||||
this,
|
||||
"clear",
|
||||
keepAliveDuration + bufferTime
|
||||
@ -40,7 +38,7 @@ export default Component.extend({
|
||||
|
||||
@on("willDestroyElement")
|
||||
_destroyed() {
|
||||
cancel(this._clearTimer);
|
||||
Ember.run.cancel(this._clearTimer);
|
||||
this.messageBus.unsubscribe(this.channel);
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user