mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 19:47:04 +03:00
Delete unused unsubmitted objects
This commit is contained in:
@@ -511,7 +511,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
|
|
||||||
Config.config.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimesSubmitting;
|
Config.config.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimesSubmitting;
|
||||||
Config.forceUpdate("unsubmittedSegments");
|
Config.forceUpdate("unsubmittedSegments");
|
||||||
|
|
||||||
this.props.contentContainer().updatePreviewBar();
|
this.props.contentContainer().updatePreviewBar();
|
||||||
|
|
||||||
if (sponsorTimesSubmitting[this.props.index].actionType === ActionType.Full
|
if (sponsorTimesSubmitting[this.props.index].actionType === ActionType.Full
|
||||||
@@ -556,7 +556,11 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
sponsorTimes.splice(index, 1);
|
sponsorTimes.splice(index, 1);
|
||||||
|
|
||||||
//save this
|
//save this
|
||||||
Config.config.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimes;
|
if (sponsorTimes.length > 0) {
|
||||||
|
Config.config.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimes;
|
||||||
|
} else {
|
||||||
|
delete Config.config.unsubmittedSegments[this.props.contentContainer().sponsorVideoID];
|
||||||
|
}
|
||||||
Config.forceUpdate("unsubmittedSegments");
|
Config.forceUpdate("unsubmittedSegments");
|
||||||
|
|
||||||
this.props.contentContainer().updatePreviewBar();
|
this.props.contentContainer().updatePreviewBar();
|
||||||
|
|||||||
Reference in New Issue
Block a user