Skip to content

Commit

Permalink
allow render for captionsList only if plugin is active
Browse files Browse the repository at this point in the history
  • Loading branch information
inbalvasserman committed Jan 30, 2025
1 parent a11a220 commit a2d86fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/components/caption-list/captionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,23 @@ export interface Props {
activeSearchIndex: number;
searchMap: Record<string, Record<string, number>>;
captionProps: CaptionProps;
kitchenSinkActive: boolean;
}
export class CaptionList extends Component<Props> {
private _currentCaptionRef: any = null;
private _firstCaptionRef: any = null;
private _lastCaptionRef: any = null;
shouldComponentUpdate(nextProps: Readonly<Props>) {
const {highlightedMap, data, searchMap, activeSearchIndex, isAutoScrollEnabled, captionProps} = this.props;
const {highlightedMap, data, searchMap, activeSearchIndex, isAutoScrollEnabled, captionProps, kitchenSinkActive} = this.props;
if (
kitchenSinkActive && (
highlightedMap !== nextProps.highlightedMap ||
data !== nextProps.data ||
searchMap !== nextProps.searchMap ||
activeSearchIndex !== nextProps.activeSearchIndex ||
isAutoScrollEnabled !== nextProps.isAutoScrollEnabled ||
captionProps.videoDuration !== nextProps.captionProps.videoDuration
) {
)) {
return true;
}
return false;
Expand Down
3 changes: 2 additions & 1 deletion src/components/transcript/transcript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
};

private _renderTranscript = () => {
const {captions, hasError, onRetryLoad, showTime, videoDuration, highlightedMap} = this.props;
const {captions, hasError, onRetryLoad, showTime, videoDuration, highlightedMap, kitchenSinkActive} = this.props;
const {isAutoScrollEnabled, searchMap, activeSearchIndex, searchLength} = this.state;

if (hasError) {
Expand Down Expand Up @@ -441,6 +441,7 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
widgetWidth={this.state.widgetWidth}
showItemsIcons={true}
searchActive={false}
kitchenSinkActive={kitchenSinkActive}
/>
);
};
Expand Down

0 comments on commit a2d86fb

Please sign in to comment.