From fc4188746340b65b7615ca0dd07f81ed7a5e53cd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 25 Nov 2020 11:56:19 +0100 Subject: [PATCH] Fix 00:00 player timestamp --- client/angular.json | 1 + client/src/assets/player/utils.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/angular.json b/client/angular.json index 5ecc335cb..cf92c7ade 100644 --- a/client/angular.json +++ b/client/angular.json @@ -150,6 +150,7 @@ "linkifyjs/html", "linkifyjs", "markdown-it", + "markdown-it-emoji/light", "sanitize-html", "socket.io-client", "socket.io-parser", diff --git a/client/src/assets/player/utils.ts b/client/src/assets/player/utils.ts index 280f721bd..6767459ce 100644 --- a/client/src/assets/player/utils.ts +++ b/client/src/assets/player/utils.ts @@ -68,7 +68,7 @@ function buildVideoLink (options: { const params = generateParams(window.location.search) - if (options.startTime) { + if (options.startTime !== undefined && options.startTime !== null) { const startTimeInt = Math.floor(options.startTime) params.set('start', secondsToTime(startTimeInt)) } @@ -146,6 +146,8 @@ function timeToInt (time: number | string) { function secondsToTime (seconds: number, full = false, symbol?: string) { let time = '' + if (seconds === 0 && !full) return '0s' + const hourSymbol = (symbol || 'h') const minuteSymbol = (symbol || 'm') const secondsSymbol = full ? '' : 's'