aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAjay <[email protected]>2022-02-07 17:38:39 -0500
committerAjay <[email protected]>2022-02-07 17:38:39 -0500
commit43699c1875251e262e8fc77b4b0599c4ba05aea2 (patch)
treee76fdf551ed522d2d869d4aab6527b929b4e6b37 /src
parent6128d37ac2e795c888010b378a8c45f775c44d82 (diff)
downloadSponsorBlock-43699c1875251e262e8fc77b4b0599c4ba05aea2.tar.gz
SponsorBlock-43699c1875251e262e8fc77b4b0599c4ba05aea2.zip
Add unsubmitted segments after deleting old variable
Diffstat (limited to 'src')
-rw-r--r--src/config.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/config.ts b/src/config.ts
index cf3dad1c..5113460f 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -397,11 +397,12 @@ async function fetchConfig(): Promise<void> {
function migrateOldSyncFormats(config: SBConfig) {
if (config["segmentTimes"]) {
+ const unsubmittedSegments = {};
for (const item of config["segmentTimes"]) {
- config.unsubmittedSegments[item[0]] = item[1];
+ unsubmittedSegments[item[0]] = item[1];
}
- chrome.storage.sync.remove("segmentTimes");
+ chrome.storage.sync.remove("segmentTimes", () => config.unsubmittedSegments = unsubmittedSegments);
}
if (!config["exclusive_accessCategoryAdded"] && !config.categorySelections.some((s) => s.name === "exclusive_access")) {