diff options
Diffstat (limited to 'client/src/app/core/routing/scroll.service.ts')
-rw-r--r-- | client/src/app/core/routing/scroll.service.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/client/src/app/core/routing/scroll.service.ts b/client/src/app/core/routing/scroll.service.ts index 6d37fde71..0966255b3 100644 --- a/client/src/app/core/routing/scroll.service.ts +++ b/client/src/app/core/routing/scroll.service.ts | |||
@@ -4,8 +4,9 @@ import { ViewportScroller } from '@angular/common' | |||
4 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
5 | import { RouterSetting } from '../' | 5 | import { RouterSetting } from '../' |
6 | import { PeerTubeRouterService } from './peertube-router.service' | 6 | import { PeerTubeRouterService } from './peertube-router.service' |
7 | import { logger } from '@root-helpers/logger' | ||
7 | 8 | ||
8 | const logger = debug('peertube:main:ScrollService') | 9 | const debugLogger = debug('peertube:main:ScrollService') |
9 | 10 | ||
10 | @Injectable() | 11 | @Injectable() |
11 | export class ScrollService { | 12 | export class ScrollService { |
@@ -57,8 +58,8 @@ export class ScrollService { | |||
57 | if (nextSearchParams.toString() !== previousSearchParams.toString()) { | 58 | if (nextSearchParams.toString() !== previousSearchParams.toString()) { |
58 | this.resetScroll = true | 59 | this.resetScroll = true |
59 | } | 60 | } |
60 | } catch (e) { | 61 | } catch (err) { |
61 | console.error('Cannot parse URL to check next scroll.', e) | 62 | logger.error('Cannot parse URL to check next scroll.', err) |
62 | this.resetScroll = true | 63 | this.resetScroll = true |
63 | } | 64 | } |
64 | }) | 65 | }) |
@@ -67,7 +68,7 @@ export class ScrollService { | |||
67 | private consumeScroll () { | 68 | private consumeScroll () { |
68 | // Handle anchors/restore position | 69 | // Handle anchors/restore position |
69 | this.peertubeRouter.getScrollEvents().subscribe(e => { | 70 | this.peertubeRouter.getScrollEvents().subscribe(e => { |
70 | logger('Will schedule scroll after router event %o.', { e, resetScroll: this.resetScroll }) | 71 | debugLogger('Will schedule scroll after router event %o.', { e, resetScroll: this.resetScroll }) |
71 | 72 | ||
72 | // scrollToAnchor first to preserve anchor position when using history navigation | 73 | // scrollToAnchor first to preserve anchor position when using history navigation |
73 | if (e.anchor) { | 74 | if (e.anchor) { |