diff options
author | Ajay <[email protected]> | 2024-01-05 13:26:55 -0500 |
---|---|---|
committer | Ajay <[email protected]> | 2024-01-05 13:26:55 -0500 |
commit | a3c43c868abb56af6f1f516f305f74d1efd44029 (patch) | |
tree | 3bdd1f1f277e296680b6d59cc0dd96c3a6b431f4 /src | |
parent | 8e366b1450f464f6c1046d0644d8d0a16bf2aeb3 (diff) | |
download | SponsorBlock-a3c43c868abb56af6f1f516f305f74d1efd44029.tar.gz SponsorBlock-a3c43c868abb56af6f1f516f305f74d1efd44029.zip |
Fix unsubmitted segments sometimes not saving properly
Fixes #1502
Diffstat (limited to 'src')
-rw-r--r-- | src/components/SponsorTimeEditComponent.tsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 63f03cf9..001755dd 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -143,7 +143,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo className="sponsorTimeEdit sponsorTimeEditInput" type="text" style={{color: "inherit", backgroundColor: "inherit"}} - value={this.state.sponsorTimeEdits[0]} + value={this.state.sponsorTimeEdits[0] ?? ""} onKeyDown={(e) => e.stopPropagation()} onKeyUp={(e) => e.stopPropagation()} onChange={(e) => this.handleOnChange(0, e, sponsorTime, e.target.value)} @@ -160,7 +160,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo className="sponsorTimeEdit sponsorTimeEditInput" type="text" style={{color: "inherit", backgroundColor: "inherit"}} - value={this.state.sponsorTimeEdits[1]} + value={this.state.sponsorTimeEdits[1] ?? ""} onKeyDown={(e) => e.stopPropagation()} onKeyUp={(e) => e.stopPropagation()} onChange={(e) => this.handleOnChange(1, e, sponsorTime, e.target.value)} @@ -622,6 +622,9 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo if (addingTime) { this.props.contentContainer().updateEditButtonsOnPlayer(); } + } else if (startTime !== null) { + // Only start time is valid, still an incomplete segment + sponsorTimesSubmitting[this.props.index].segment[0] = startTime; } } else if (this.state.sponsorTimeEdits[1] === null && category === "outro" && !sponsorTimesSubmitting[this.props.index].segment[1]) { sponsorTimesSubmitting[this.props.index].segment[1] = this.props.contentContainer().v.duration; |