Revert Ember.run refactors

This reverts commit 5ca60fcb6b592524086f98279d3e4fd949598343.
This commit is contained in:
Robin Ward
2019-10-29 17:10:47 -04:00
parent cfa5d123a3
commit fcb1ca52f9
153 changed files with 319 additions and 493 deletions

View File

@ -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

View File

@ -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);
},