diff options
author | Ajay <[email protected]> | 2022-02-22 01:21:18 -0500 |
---|---|---|
committer | Ajay <[email protected]> | 2022-02-22 01:21:18 -0500 |
commit | 84a234f9b63ea9cfa95aec85db7980e337ce5fec (patch) | |
tree | 233d043aa3ec3c491c3445d45908858e1061cfd6 | |
parent | fd5ab9f1533868e9cbb3bbe14653538a2581964f (diff) | |
download | SponsorBlock-4.1.4.tar.gz SponsorBlock-4.1.4.zip |
Fix full video saving old times4.1.4
Fix #1198
-rw-r--r-- | src/components/SponsorTimeEditComponent.tsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 4278ecb6..79922239 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -381,21 +381,21 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo } const sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index]; - this.handleReplacingLostTimes(event.target.value as Category, sponsorTime.actionType); + this.handleReplacingLostTimes(event.target.value as Category, sponsorTime.actionType, sponsorTime); this.saveEditTimes(); } actionTypeSelectionChange(event: React.ChangeEvent<HTMLSelectElement>): void { const sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index]; - this.handleReplacingLostTimes(sponsorTime.category, event.target.value as ActionType); + this.handleReplacingLostTimes(sponsorTime.category, event.target.value as ActionType, sponsorTime); this.saveEditTimes(); } - private handleReplacingLostTimes(category: Category, actionType: ActionType): void { + private handleReplacingLostTimes(category: Category, actionType: ActionType, segment: SponsorTime): void { if (CompileConfig.categorySupport[category]?.includes(ActionType.Poi)) { if (this.previousSkipType !== ActionType.Poi) { - this.timesBeforeChanging = [null, utils.getFormattedTimeToSeconds(this.state.sponsorTimeEdits[1])]; + this.timesBeforeChanging = [null, segment.segment[1]]; } this.setTimeTo(1, null); @@ -410,12 +410,13 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo } else if (CompileConfig.categorySupport[category]?.length === 1 && CompileConfig.categorySupport[category]?.[0] === ActionType.Full) { if (this.previousSkipType !== ActionType.Full) { - this.timesBeforeChanging = [utils.getFormattedTimeToSeconds(this.state.sponsorTimeEdits[0]), utils.getFormattedTimeToSeconds(this.state.sponsorTimeEdits[1])]; + this.timesBeforeChanging = [...segment.segment]; } this.previousSkipType = ActionType.Full; - } else if (CompileConfig.categorySupport[category]?.includes(ActionType.Skip) - && ![ActionType.Poi, ActionType.Full].includes(this.getNextActionType(category, actionType)) && this.previousSkipType !== ActionType.Skip) { + } else if ((category === "chooseACategory" || (CompileConfig.categorySupport[category]?.includes(ActionType.Skip) + && ![ActionType.Poi, ActionType.Full].includes(this.getNextActionType(category, actionType)))) + && this.previousSkipType !== ActionType.Skip) { if (this.timesBeforeChanging[0]) { this.setTimeTo(0, this.timesBeforeChanging[0]); } |