From 00a7e6d261b77971f074a4f5acc2d8d50c79763e Mon Sep 17 00:00:00 2001 From: hanyd Date: Tue, 3 Dec 2024 08:08:39 +0800 Subject: [PATCH] stash --- src/components/SkipNoticeComponent.tsx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) 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;