mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 01:01:55 +01:00
Fix unsubmitted segments not saving
This commit is contained in:
parent
a3c43c868a
commit
778d823820
7 changed files with 14 additions and 14 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 69d771d0f3b96951c970a9eacb046b808907bb1c
|
||||
Subproject commit e2b43d4101009f2157ee2e0cd54e1536953e54c1
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsPr
|
|||
});
|
||||
}
|
||||
|
||||
Config.forceSyncUpdate("categorySelections");
|
||||
Config.forceLocalUpdate("categorySelections");
|
||||
}
|
||||
|
||||
getCategorySkipOptions(): JSX.Element[] {
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -308,7 +308,7 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
|
|||
|
||||
if (addedSegments) {
|
||||
Config.local.unsubmittedSegments[getVideoID()] = sponsorTimesSubmitting;
|
||||
Config.forceSyncUpdate("unsubmittedSegments");
|
||||
Config.forceLocalUpdate("unsubmittedSegments");
|
||||
|
||||
updateEditButtonsOnPlayer();
|
||||
updateSponsorTimesSubmitting(false);
|
||||
|
@ -1926,7 +1926,7 @@ function startOrEndTimingNewSegment() {
|
|||
|
||||
// Save the newly created segment
|
||||
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
|
||||
sponsorsLookup();
|
||||
|
@ -1964,7 +1964,7 @@ function cancelCreatingSegment() {
|
|||
sponsorTimesSubmitting = [];
|
||||
delete Config.local.unsubmittedSegments[getVideoID()];
|
||||
}
|
||||
Config.forceSyncUpdate("unsubmittedSegments");
|
||||
Config.forceLocalUpdate("unsubmittedSegments");
|
||||
}
|
||||
|
||||
updateEditButtonsOnPlayer();
|
||||
|
@ -2113,7 +2113,7 @@ function clearSponsorTimes() {
|
|||
|
||||
//clear the sponsor times
|
||||
delete Config.local.unsubmittedSegments[currentVideoID];
|
||||
Config.forceSyncUpdate("unsubmittedSegments");
|
||||
Config.forceLocalUpdate("unsubmittedSegments");
|
||||
|
||||
//clear sponsor times submitting
|
||||
sponsorTimesSubmitting = [];
|
||||
|
@ -2277,7 +2277,7 @@ async function sendSubmitMessage() {
|
|||
|
||||
//update sponsorTimes
|
||||
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
|
||||
if (Config.config.minDuration > 0) {
|
||||
|
@ -2305,7 +2305,7 @@ async function sendSubmitMessage() {
|
|||
|
||||
// Remove segments from storage since they've already been submitted
|
||||
delete Config.local.unsubmittedSegments[getVideoID()];
|
||||
Config.forceSyncUpdate("unsubmittedSegments");
|
||||
Config.forceLocalUpdate("unsubmittedSegments");
|
||||
|
||||
const newSegments = sponsorTimesSubmitting;
|
||||
try {
|
||||
|
@ -2611,7 +2611,7 @@ function checkForPreloadedSegment() {
|
|||
|
||||
if (pushed) {
|
||||
Config.local.unsubmittedSegments[getVideoID()] = sponsorTimesSubmitting;
|
||||
Config.forceSyncUpdate("unsubmittedSegments");
|
||||
Config.forceLocalUpdate("unsubmittedSegments");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue