mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 12:37:05 +03:00
Clean up segment creation code
Noteworthy changes: - Adds ability to cancel creating a segment - Makes segment creation fully the responsibility of the content script, with the popup script buttons simply doing RPC - Adds types to the Utils.wait function - Fixes segment timestamps backwards if user marks segment end earlier than the start - Makes the info menu (in-page popup) workaround clearer and easier to remove in the future.
This commit is contained in:
@@ -344,7 +344,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
||||
//if it is not a complete sponsor time
|
||||
if (sponsorTimes[index].segment.length < 2) {
|
||||
//update video player
|
||||
this.props.contentContainer().changeStartSponsorButton(true, false);
|
||||
this.props.contentContainer().updateEditButtonsOnPlayer();
|
||||
}
|
||||
|
||||
sponsorTimes.splice(index, 1);
|
||||
@@ -359,7 +359,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
||||
this.props.submissionNotice.cancel();
|
||||
|
||||
//update video player
|
||||
this.props.contentContainer().changeStartSponsorButton(true, false);
|
||||
this.props.contentContainer().updateEditButtonsOnPlayer();
|
||||
} else {
|
||||
//update display
|
||||
this.props.submissionNotice.forceUpdate();
|
||||
|
||||
Reference in New Issue
Block a user