aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-27 09:02:35 +0200
committerChocobozzz <me@florianbigard.com>2021-04-27 09:02:35 +0200
commite1a5ad703f99483fbb8daa3dc71b85ef5022c85f (patch)
treec7e0a70d260500cbced0e313df86756f1b031107
parentc9ae74d6bc2918ac38ce2dd25aa8c542132529ef (diff)
downloadPeerTube-e1a5ad703f99483fbb8daa3dc71b85ef5022c85f.tar.gz
PeerTube-e1a5ad703f99483fbb8daa3dc71b85ef5022c85f.tar.zst
PeerTube-e1a5ad703f99483fbb8daa3dc71b85ef5022c85f.zip
Fix playlist position error
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts
index 107826824..1c510d6b0 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -189,11 +189,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
189 189
190 this.queryParamsSub = this.route.queryParams.subscribe(queryParams => { 190 this.queryParamsSub = this.route.queryParams.subscribe(queryParams => {
191 // Handle the ?playlistPosition 191 // Handle the ?playlistPosition
192 const positionParam = queryParams[ 'playlistPosition' ] 192 const positionParam = queryParams[ 'playlistPosition' ] ?? 1
193 193
194 this.playlistPosition = positionParam === 'last' 194 this.playlistPosition = positionParam === 'last'
195 ? -1 // Handle the "last" index 195 ? -1 // Handle the "last" index
196 : parseInt(positionParam, 10) 196 : parseInt(positionParam + '', 10)
197 197
198 if (isNaN(this.playlistPosition)) { 198 if (isNaN(this.playlistPosition)) {
199 console.error(`playlistPosition query param '${positionParam}' was parsed as NaN, defaulting to 1.`) 199 console.error(`playlistPosition query param '${positionParam}' was parsed as NaN, defaulting to 1.`)