Fix unsubmitted segments not saving

This commit is contained in:
Ajay
2024-01-05 22:21:51 -05:00
parent a3c43c868a
commit 778d823820
7 changed files with 14 additions and 14 deletions

View File

@@ -566,7 +566,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
const segmentTimes = Config.local.unsubmittedSegments[sponsorVideoID] || [];
segmentTimes.push(sponsorTimesSubmitting);
Config.local.unsubmittedSegments[sponsorVideoID] = segmentTimes;
Config.forceSyncUpdate("unsubmittedSegments");
Config.forceLocalUpdate("unsubmittedSegments");
this.props.contentContainer().sponsorTimesSubmitting.push(sponsorTimesSubmitting);
this.props.contentContainer().updatePreviewBar();

View File

@@ -640,7 +640,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
sponsorTimesSubmitting[this.props.index].description = description;
Config.local.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimesSubmitting;
Config.forceSyncUpdate("unsubmittedSegments");
Config.forceLocalUpdate("unsubmittedSegments");
this.props.contentContainer().updatePreviewBar();
@@ -694,7 +694,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
} else {
delete Config.local.unsubmittedSegments[this.props.contentContainer().sponsorVideoID];
}
Config.forceSyncUpdate("unsubmittedSegments");
Config.forceLocalUpdate("unsubmittedSegments");
this.props.contentContainer().updatePreviewBar();

View File

@@ -238,7 +238,7 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
sponsorTimesSubmitting = sponsorTimesSubmitting.sort((a, b) => a.segment[0] - b.segment[0]);
Config.local.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimesSubmitting;
Config.forceSyncUpdate("unsubmittedSegments");
Config.forceLocalUpdate("unsubmittedSegments");
this.forceUpdate();
}

View File

@@ -158,7 +158,7 @@ class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsPr
});
}
Config.forceSyncUpdate("categorySelections");
Config.forceLocalUpdate("categorySelections");
}
getCategorySkipOptions(): JSX.Element[] {

View File

@@ -70,7 +70,7 @@ class UnsubmittedVideoListItem extends React.Component<UnsubmittedVideosListItem
clearSegments(): void {
if (confirm(chrome.i18n.getMessage("clearThis"))) {
delete Config.local.unsubmittedSegments[this.props.videoID];
Config.forceSyncUpdate("unsubmittedSegments");
Config.forceLocalUpdate("unsubmittedSegments");
}
}