aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/popup.ts
diff options
context:
space:
mode:
authorAjay <[email protected]>2023-12-23 13:16:19 -0500
committerAjay <[email protected]>2023-12-23 13:16:19 -0500
commit8e366b1450f464f6c1046d0644d8d0a16bf2aeb3 (patch)
tree3a32d1856f9979823c427281d046cbccedb90eaf /src/popup.ts
parent58d503636324b29269957410e060571e387c24b9 (diff)
downloadSponsorBlock-8e366b1450f464f6c1046d0644d8d0a16bf2aeb3.tar.gz
SponsorBlock-8e366b1450f464f6c1046d0644d8d0a16bf2aeb3.zip
Move unsubmitted segments to local storage to remove limits
Also add a way to export local storage Fixes #1933
Diffstat (limited to 'src/popup.ts')
-rw-r--r--src/popup.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/popup.ts b/src/popup.ts
index 562fbfcb..e1e5757f 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -435,7 +435,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
}
await utils.wait(() => Config.config !== null, 5000, 10);
- sponsorTimes = Config.config.unsubmittedSegments[currentVideoID] ?? [];
+ sponsorTimes = Config.local.unsubmittedSegments[currentVideoID] ?? [];
updateSegmentEditingUI();
messageHandler.sendMessage(
@@ -527,7 +527,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
function startSponsorCallback(response: SponsorStartResponse) {
// Only update the segments after a segment was created
if (!response.creatingSegment) {
- sponsorTimes = Config.config.unsubmittedSegments[currentVideoID] || [];
+ sponsorTimes = Config.local.unsubmittedSegments[currentVideoID] || [];
}
// Update the UI
@@ -769,7 +769,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
}
function isCreatingSegment(): boolean {
- const segments = Config.config.unsubmittedSegments[currentVideoID];
+ const segments = Config.local.unsubmittedSegments[currentVideoID];
if (!segments) return false;
const lastSegment = segments[segments.length - 1];
return lastSegment && lastSegment?.segment?.length !== 2;
@@ -1094,7 +1094,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
for (const key in changes) {
switch(key) {
case "unsubmittedSegments":
- sponsorTimes = Config.config.unsubmittedSegments[currentVideoID] ?? [];
+ sponsorTimes = Config.local.unsubmittedSegments[currentVideoID] ?? [];
updateSegmentEditingUI();
break;
}
@@ -1144,7 +1144,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
break;
case "videoChanged":
currentVideoID = msg.videoID
- sponsorTimes = Config.config.unsubmittedSegments[currentVideoID] ?? [];
+ sponsorTimes = Config.local.unsubmittedSegments[currentVideoID] ?? [];
updateSegmentEditingUI();
if (msg.whitelisted) {