From 07396efec1f99b1aae5ae015b4441c558cd9f3c6 Mon Sep 17 00:00:00 2001
From: jojohoch <joachim.hoch@iqb.hu-berlin.de>
Date: Mon, 23 Aug 2021 11:45:17 +0200
Subject: [PATCH] [player] Remove unused scroll subscription

Intersection detection is done by `Intersectionobserver`
---
 projects/player/src/app/app.component.ts                 | 6 ------
 projects/player/src/app/services/native-event.service.ts | 7 -------
 2 files changed, 13 deletions(-)

diff --git a/projects/player/src/app/app.component.ts b/projects/player/src/app/app.component.ts
index 6be1617b5..18ee30592 100644
--- a/projects/player/src/app/app.component.ts
+++ b/projects/player/src/app/app.component.ts
@@ -42,8 +42,6 @@ export class AppComponent implements OnInit {
   private initSubscriptions(): void {
     this.veronaSubscriptionService.vopStartCommand
       .subscribe((message: VopStartCommand): void => this.onStart(message));
-    this.nativeEventService.scrollY
-      .subscribe((y: number): void => this.onScrollY(y));
     this.nativeEventService.focus
       .subscribe((focused: boolean): void => this.onFocus(focused));
   }
@@ -111,10 +109,6 @@ export class AppComponent implements OnInit {
         }))
     }));
 
-  // eslint-disable-next-line @typescript-eslint/no-unused-vars
-  private onScrollY = (y: number): void => {
-  };
-
   private onFocus(focused: boolean): void {
     // eslint-disable-next-line no-console
     console.log('player: onFocus', focused);
diff --git a/projects/player/src/app/services/native-event.service.ts b/projects/player/src/app/services/native-event.service.ts
index 8640516b4..4561cb172 100644
--- a/projects/player/src/app/services/native-event.service.ts
+++ b/projects/player/src/app/services/native-event.service.ts
@@ -9,12 +9,9 @@ import { mergeMap } from 'rxjs/operators';
   providedIn: 'root'
 })
 export class NativeEventService {
-  private _scrollY = new Subject<number>();
   private _focus = new Subject<boolean>();
 
   constructor(@Inject(DOCUMENT) private document: Document) {
-    fromEvent(window, 'scroll')
-      .subscribe(() => this._scrollY.next(window.scrollY));
     from(['blur', 'focus'])
       .pipe(
         mergeMap(event => fromEvent(window, event))
@@ -24,10 +21,6 @@ export class NativeEventService {
       );
   }
 
-  get scrollY(): Observable<number> {
-    return this._scrollY.asObservable();
-  }
-
   get focus(): Observable<boolean> {
     return this._focus.asObservable();
   }
-- 
GitLab