diff --git a/client/src/app/shared/video/infinite-scroller.directive.ts b/client/src/app/shared/video/infinite-scroller.directive.ts index ed49a9e81..e0f9f4f83 100644 --- a/client/src/app/shared/video/infinite-scroller.directive.ts +++ b/client/src/app/shared/video/infinite-scroller.directive.ts @@ -38,12 +38,13 @@ export class InfiniteScrollerDirective implements OnInit { initialize () { // Emit the last value - const throttleOptions = { leading: false, trailing: true } + const throttleOptions = { leading: true, trailing: true } const scrollObservable = fromEvent(window, 'scroll') .startWith(true) .throttleTime(200, undefined, throttleOptions) .map(() => ({ current: window.scrollY, maximumScroll: document.body.clientHeight - window.innerHeight })) + .distinctUntilChanged((o1, o2) => o1.current === o2.current) .share() // Scroll Down