From d1dde2428f18ffa7e2307fe2c05442b1db01d182 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Sun, 4 Jun 2023 16:20:21 -0700 Subject: [PATCH] Minor fixes on main component --- src/renderer/features/lyrics/lyrics.tsx | 32 +++++++++++++------------ 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/renderer/features/lyrics/lyrics.tsx b/src/renderer/features/lyrics/lyrics.tsx index 6f50a6f8..ec1380df 100644 --- a/src/renderer/features/lyrics/lyrics.tsx +++ b/src/renderer/features/lyrics/lyrics.tsx @@ -88,7 +88,7 @@ export const Lyrics = () => { const [, minute, sec, ms, text] = line; const minutes = parseInt(minute, 10); const seconds = parseInt(sec, 10); - const milis = ms.length === 3 ? parseInt(ms, 10) : parseInt(ms, 10) * 10; + const milis = ms?.length === 3 ? parseInt(ms, 10) : parseInt(ms, 10) * 10; const timeInMilis = (minutes * 60 + seconds) * 1000 + milis; synchronizedTimes.push([timeInMilis, text]); @@ -106,8 +106,8 @@ export const Lyrics = () => { return ( - {!songLyrics && ( -
+ {!songLyrics ? ( +
{
+ ) : ( + <> + {Array.isArray(songLyrics) ? ( + + ) : ( + + )} + )} - {songLyrics && - (Array.isArray(songLyrics) ? ( - - ) : ( - - ))} ); };