X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Frouting%2Fscroll.service.ts;h=0966255b3b42337fd1e25317f6670547a6d22214;hb=b1dbb9fefc870a90b25f5c0153589f45c9e75e3e;hp=6d37fde71cb7c2b9d64be72a3000e7c95db2cef4;hpb=83b1b7eaf1c04837f92de497e74895bee808eb83;p=github%2FChocobozzz%2FPeerTube.git 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' import { Injectable } from '@angular/core' import { RouterSetting } from '../' import { PeerTubeRouterService } from './peertube-router.service' +import { logger } from '@root-helpers/logger' -const logger = debug('peertube:main:ScrollService') +const debugLogger = debug('peertube:main:ScrollService') @Injectable() export class ScrollService { @@ -57,8 +58,8 @@ export class ScrollService { if (nextSearchParams.toString() !== previousSearchParams.toString()) { this.resetScroll = true } - } catch (e) { - console.error('Cannot parse URL to check next scroll.', e) + } catch (err) { + logger.error('Cannot parse URL to check next scroll.', err) this.resetScroll = true } }) @@ -67,7 +68,7 @@ export class ScrollService { private consumeScroll () { // Handle anchors/restore position this.peertubeRouter.getScrollEvents().subscribe(e => { - logger('Will schedule scroll after router event %o.', { e, resetScroll: this.resetScroll }) + debugLogger('Will schedule scroll after router event %o.', { e, resetScroll: this.resetScroll }) // scrollToAnchor first to preserve anchor position when using history navigation if (e.anchor) {