diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index a84f33be..52f84be9 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -128,16 +128,15 @@ class SkipNoticeComponent extends React.Component 0) { - countDown = Number(Config.config.skipNoticeDurationBefore) + Number(Config.config.skipNoticeDuration); - } else { - countDown = Number(Config.config.skipNoticeDuration); - } + const calculateCountDown = () => { + if (Config.config.advanceSkipNotice && Config.config.skipNoticeDurationBefore > 0) { + return Config.config.skipNoticeDurationBefore + Config.config.skipNoticeDuration; + } else { + return Config.config.skipNoticeDuration; + } + }; const isMuteSegment = this.segments[0].actionType === ActionType.Mute; - const maxCountdownTime = isMuteSegment - ? this.getFullDurationCountdown(0) - : () => countDown; + const maxCountdownTime = isMuteSegment ? this.getFullDurationCountdown(0) : calculateCountDown; const defaultSkipButtonState = this.props.startReskip ? SkipButtonState.Redo : SkipButtonState.Undo; const skipButtonStates = [ @@ -684,7 +683,7 @@ class SkipNoticeComponent extends React.Component 0) { if (this.props.segments[0].segment[0] > getVideo().currentTime) { - countDown = Number(Config.config.skipNoticeDurationBefore) + Number(Config.config.skipNoticeDuration); + countDown = Config.config.skipNoticeDurationBefore + Config.config.skipNoticeDuration; } else { if (Config.config.skipNoticeDuration < 1) { countDown = Config.config.skipNoticeDurationBefore;