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

@ -1 +1 @@
Subproject commit 69d771d0f3b96951c970a9eacb046b808907bb1c Subproject commit e2b43d4101009f2157ee2e0cd54e1536953e54c1

View file

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

View file

@ -640,7 +640,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
sponsorTimesSubmitting[this.props.index].description = description; sponsorTimesSubmitting[this.props.index].description = description;
Config.local.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimesSubmitting; Config.local.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimesSubmitting;
Config.forceSyncUpdate("unsubmittedSegments"); Config.forceLocalUpdate("unsubmittedSegments");
this.props.contentContainer().updatePreviewBar(); this.props.contentContainer().updatePreviewBar();
@ -694,7 +694,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
} else { } else {
delete Config.local.unsubmittedSegments[this.props.contentContainer().sponsorVideoID]; delete Config.local.unsubmittedSegments[this.props.contentContainer().sponsorVideoID];
} }
Config.forceSyncUpdate("unsubmittedSegments"); Config.forceLocalUpdate("unsubmittedSegments");
this.props.contentContainer().updatePreviewBar(); 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]); sponsorTimesSubmitting = sponsorTimesSubmitting.sort((a, b) => a.segment[0] - b.segment[0]);
Config.local.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimesSubmitting; Config.local.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimesSubmitting;
Config.forceSyncUpdate("unsubmittedSegments"); Config.forceLocalUpdate("unsubmittedSegments");
this.forceUpdate(); this.forceUpdate();
} }

View file

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

View file

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

View file

@ -308,7 +308,7 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
if (addedSegments) { if (addedSegments) {
Config.local.unsubmittedSegments[getVideoID()] = sponsorTimesSubmitting; Config.local.unsubmittedSegments[getVideoID()] = sponsorTimesSubmitting;
Config.forceSyncUpdate("unsubmittedSegments"); Config.forceLocalUpdate("unsubmittedSegments");
updateEditButtonsOnPlayer(); updateEditButtonsOnPlayer();
updateSponsorTimesSubmitting(false); updateSponsorTimesSubmitting(false);
@ -1926,7 +1926,7 @@ function startOrEndTimingNewSegment() {
// Save the newly created segment // Save the newly created segment
Config.local.unsubmittedSegments[getVideoID()] = sponsorTimesSubmitting; Config.local.unsubmittedSegments[getVideoID()] = sponsorTimesSubmitting;
Config.forceSyncUpdate("unsubmittedSegments"); Config.forceLocalUpdate("unsubmittedSegments");
// Make sure they know if someone has already submitted something it while they were watching // Make sure they know if someone has already submitted something it while they were watching
sponsorsLookup(); sponsorsLookup();
@ -1964,7 +1964,7 @@ function cancelCreatingSegment() {
sponsorTimesSubmitting = []; sponsorTimesSubmitting = [];
delete Config.local.unsubmittedSegments[getVideoID()]; delete Config.local.unsubmittedSegments[getVideoID()];
} }
Config.forceSyncUpdate("unsubmittedSegments"); Config.forceLocalUpdate("unsubmittedSegments");
} }
updateEditButtonsOnPlayer(); updateEditButtonsOnPlayer();
@ -2113,7 +2113,7 @@ function clearSponsorTimes() {
//clear the sponsor times //clear the sponsor times
delete Config.local.unsubmittedSegments[currentVideoID]; delete Config.local.unsubmittedSegments[currentVideoID];
Config.forceSyncUpdate("unsubmittedSegments"); Config.forceLocalUpdate("unsubmittedSegments");
//clear sponsor times submitting //clear sponsor times submitting
sponsorTimesSubmitting = []; sponsorTimesSubmitting = [];
@ -2277,7 +2277,7 @@ async function sendSubmitMessage() {
//update sponsorTimes //update sponsorTimes
Config.local.unsubmittedSegments[getVideoID()] = sponsorTimesSubmitting; Config.local.unsubmittedSegments[getVideoID()] = sponsorTimesSubmitting;
Config.forceSyncUpdate("unsubmittedSegments"); Config.forceLocalUpdate("unsubmittedSegments");
// Check to see if any of the submissions are below the minimum duration set // Check to see if any of the submissions are below the minimum duration set
if (Config.config.minDuration > 0) { if (Config.config.minDuration > 0) {
@ -2305,7 +2305,7 @@ async function sendSubmitMessage() {
// Remove segments from storage since they've already been submitted // Remove segments from storage since they've already been submitted
delete Config.local.unsubmittedSegments[getVideoID()]; delete Config.local.unsubmittedSegments[getVideoID()];
Config.forceSyncUpdate("unsubmittedSegments"); Config.forceLocalUpdate("unsubmittedSegments");
const newSegments = sponsorTimesSubmitting; const newSegments = sponsorTimesSubmitting;
try { try {
@ -2611,7 +2611,7 @@ function checkForPreloadedSegment() {
if (pushed) { if (pushed) {
Config.local.unsubmittedSegments[getVideoID()] = sponsorTimesSubmitting; Config.local.unsubmittedSegments[getVideoID()] = sponsorTimesSubmitting;
Config.forceSyncUpdate("unsubmittedSegments"); Config.forceLocalUpdate("unsubmittedSegments");
} }
} }