mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Run post stream scroll events less often (#11463)
See PR for details.
This commit is contained in:
parent
8940e0f163
commit
b24a77ff91
@ -7,6 +7,8 @@ import { isWorkaroundActive } from "discourse/lib/safari-hacks";
|
||||
import offsetCalculator from "discourse/lib/offset-calculator";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
const DEBOUNCE_DELAY = 50;
|
||||
|
||||
function findTopView($posts, viewportTop, postsWrapperTop, min, max) {
|
||||
if (max < min) {
|
||||
return min;
|
||||
@ -311,14 +313,13 @@ export default MountWidget.extend({
|
||||
},
|
||||
|
||||
_debouncedScroll() {
|
||||
discourseDebounce(this, this._scrollTriggered, 10);
|
||||
discourseDebounce(this, this._scrollTriggered, DEBOUNCE_DELAY);
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
const debouncedScroll = () =>
|
||||
discourseDebounce(this, this._scrollTriggered, 10);
|
||||
|
||||
discourseDebounce(this, this._scrollTriggered, DEBOUNCE_DELAY);
|
||||
this._previouslyNearby = {};
|
||||
|
||||
this.appEvents.on("post-stream:refresh", this, "_debouncedScroll");
|
||||
|
Loading…
Reference in New Issue
Block a user