diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-08 15:59:05 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-11 09:37:27 +0200 |
commit | 0af2a8c5d62bc1764fc296caa67c33195a7d5174 (patch) | |
tree | fef575d42e970bf6aeb2bb17463ad2c460c799c0 /client/src/app/core | |
parent | 9db2330e4a32a3bb0fe821abec1b061e4edb65b5 (diff) | |
download | PeerTube-0af2a8c5d62bc1764fc296caa67c33195a7d5174.tar.gz PeerTube-0af2a8c5d62bc1764fc296caa67c33195a7d5174.tar.zst PeerTube-0af2a8c5d62bc1764fc296caa67c33195a7d5174.zip |
Correctly disable infinite scroll for reuse
Diffstat (limited to 'client/src/app/core')
-rw-r--r-- | client/src/app/core/routing/custom-reuse-strategy.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/client/src/app/core/routing/custom-reuse-strategy.ts b/client/src/app/core/routing/custom-reuse-strategy.ts index 3000093a8..1498e221f 100644 --- a/client/src/app/core/routing/custom-reuse-strategy.ts +++ b/client/src/app/core/routing/custom-reuse-strategy.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { ComponentRef, Injectable } from '@angular/core' |
2 | import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router' | 2 | import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router' |
3 | import { RouterSetting } from './' | 3 | import { DisableForReuseHook } from './disable-for-reuse-hook' |
4 | import { PeerTubeRouterService } from './peertube-router.service' | 4 | import { PeerTubeRouterService, RouterSetting } from './peertube-router.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class CustomReuseStrategy implements RouteReuseStrategy { | 7 | export class CustomReuseStrategy implements RouteReuseStrategy { |
@@ -22,9 +22,11 @@ export class CustomReuseStrategy implements RouteReuseStrategy { | |||
22 | const key = this.generateKey(route) | 22 | const key = this.generateKey(route) |
23 | this.recentlyUsed = key | 23 | this.recentlyUsed = key |
24 | 24 | ||
25 | console.log('Storing component %s to reuse later.', key); | 25 | console.log('Storing component %s to reuse later.', key) |
26 | 26 | ||
27 | (handle as any).componentRef.instance.disableForReuse() | 27 | const componentRef = (handle as any).componentRef as ComponentRef<DisableForReuseHook> |
28 | componentRef.instance.disableForReuse() | ||
29 | componentRef.changeDetectorRef.detectChanges() | ||
28 | 30 | ||
29 | this.storedRouteHandles.set(key, handle) | 31 | this.storedRouteHandles.set(key, handle) |
30 | 32 | ||