File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ const MainCaptionContent: React.FC<{ captions: CaptionMessage[] }> = ({
114114 key = { `${ caption . sequence_id } -${ caption . source } ` }
115115 fontWeight = { caption . is_partial ? 600 : 400 }
116116 color = { i === 0 && ! caption . is_partial ? "#707070" : "inherit" }
117+ marginRight = { "1.5rem" }
117118 >
118119 { caption . transcript } { " " }
119120 </ Text >
Original file line number Diff line number Diff line change 11import React , { useCallback , useMemo } from "react" ;
2+ import { useSearchParams } from "react-router-dom" ;
23
34import { Box , Skeleton , Text } from "@chakra-ui/react" ;
45
@@ -44,8 +45,14 @@ export const TrackCaption: React.FC<Props> = ({ track }) => {
4445export const TrackCaptionInner : React . FC < {
4546 track : TrackSlug ;
4647 captions : CaptionMessage [ ] ;
47- } > = ( { captions } ) => {
48+ } > = ( { captions : origCaptions } ) => {
4849 const box = React . useRef < HTMLDivElement > ( null ) ;
50+ const [ searchParams ] = useSearchParams ( ) ;
51+ const hidePartial = ! ! searchParams . get ( "hide_partial" ) ;
52+
53+ const captions = hidePartial
54+ ? origCaptions . filter ( ( v ) => ! v . is_partial )
55+ : origCaptions ;
4956
5057 const lastcaption =
5158 captions . length > 0 ? captions [ captions . length - 1 ] : undefined ;
You can’t perform that action at this time.
0 commit comments