Use short skip notice for highlight category

This commit is contained in:
Ajay Ramachandran
2021-07-15 16:36:42 -04:00
parent a839480a33
commit 6fa5aea680

View File

@@ -461,12 +461,14 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
}
getUnskippedModeInfo(index: number, buttonText: string): SkipNoticeState {
const maxCountdownTime = () => {
const changeCountdown = utils.getCategoryActionType(this.segments[index].category) === CategoryActionType.Skippable;
const maxCountdownTime = changeCountdown ? () => {
const sponsorTime = this.segments[index];
const duration = Math.round((sponsorTime.segment[1] - this.contentContainer().v.currentTime) * (1 / this.contentContainer().v.playbackRate));
return Math.max(duration, Config.config.skipNoticeDuration);
};
} : this.state.maxCountdownTime;
return {
unskipText: buttonText,