Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Playlist position styling
  • Loading branch information
Chocobozzz committed Apr 26, 2021
commit c257486434e35af70730d63dee843ff2df5b256d
9 changes: 6 additions & 3 deletions client/src/app/+videos/+video-watch/video-watch.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,14 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
this.queryParamsSub = this.route.queryParams.subscribe(queryParams => {
// Handle the ?playlistPosition
const positionParam = queryParams[ 'playlistPosition' ]
if (positionParam === 'last') this.playlistPosition = -1 // Handle the "last" index
else this.playlistPosition = parseInt(positionParam, 10)

this.playlistPosition = positionParam === 'last'
? -1 // Handle the "last" index
: parseInt(positionParam, 10)

if (isNaN(this.playlistPosition)) {
console.error(`playlistPosition query param '${positionParam}' was parsed as NaN, defaulting to 1.`)
this.playlistPosition = 1
console.error("'?playlistPosition=" + positionParam + "' was parsed as NaN, defaulting to 1.")
}

this.videoWatchPlaylist.updatePlaylistIndex(this.playlistPosition)
Expand Down