Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Improve infinite scroll

Chocobozzz2c6bbd97d351
diff --git a/client/src/app/shared/video/infinite-scroller.directive.ts b/client/src/app/shared/video/infinite-scroller.directive.ts
index ed49a9e81e..e0f9f4f836 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