DEV: removes setInterval as it might cause issues (#9722)
This commit is contained in:
parent
862d153f54
commit
3b2b635e9b
|
@ -1,5 +1,5 @@
|
|||
import { inject as service } from "@ember/service";
|
||||
import { throttle, debounce, schedule } from "@ember/runloop";
|
||||
import { throttle, debounce, schedule, later } from "@ember/runloop";
|
||||
import Component from "@ember/component";
|
||||
import { on, observes } from "discourse-common/utils/decorators";
|
||||
import { findRawTemplate } from "discourse-common/lib/raw-templates";
|
||||
|
@ -196,6 +196,8 @@ export default Component.extend({
|
|||
if (!this.site.isMobileDevice) {
|
||||
this._bindHover();
|
||||
}
|
||||
|
||||
later(this, this._onScroll, 100);
|
||||
},
|
||||
|
||||
_bindModalClick() {
|
||||
|
@ -221,7 +223,6 @@ export default Component.extend({
|
|||
_unbindEvents() {
|
||||
$(this.element).off();
|
||||
$(window).off("resize");
|
||||
clearInterval(this._refreshInterval);
|
||||
$("#reply-control").off("div-resizing");
|
||||
$("html").off("mouseup.emoji-picker");
|
||||
},
|
||||
|
@ -370,12 +371,11 @@ export default Component.extend({
|
|||
},
|
||||
|
||||
_bindSectionsScroll() {
|
||||
let onScroll = () => {
|
||||
debounce(this, this._checkVisibleSection, 50);
|
||||
};
|
||||
this.$list.on("scroll", this._onScroll.bind(this));
|
||||
},
|
||||
|
||||
this.$list.on("scroll", onScroll);
|
||||
this._refreshInterval = setInterval(onScroll, 100);
|
||||
_onScroll() {
|
||||
debounce(this, this._checkVisibleSection, 50);
|
||||
},
|
||||
|
||||
_checkVisibleSection(force) {
|
||||
|
@ -420,6 +420,8 @@ export default Component.extend({
|
|||
|
||||
this._loadVisibleSections();
|
||||
}
|
||||
|
||||
later(this, this._checkVisibleSection, 100);
|
||||
},
|
||||
|
||||
_loadVisibleSections() {
|
||||
|
|
Loading…
Reference in New Issue