aboutsummaryrefslogtreecommitdiffhomepage
path: root/popup.js
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2019-08-12 12:26:52 -0400
committerAjay Ramachandran <[email protected]>2019-08-12 12:26:52 -0400
commitac118173a50d47fa6ad6e69f0024e4cf07b162e3 (patch)
treec139e173188046d69adf9cc0ff28bd744bbd88b8 /popup.js
parent3f815a18c4b507e6622824c371e7aabfc72b4f6d (diff)
downloadSponsorBlock-ac118173a50d47fa6ad6e69f0024e4cf07b162e3.tar.gz
SponsorBlock-ac118173a50d47fa6ad6e69f0024e4cf07b162e3.zip
Made preview also save the edit.
Diffstat (limited to 'popup.js')
-rw-r--r--popup.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/popup.js b/popup.js
index 3359413e..0c62370e 100644
--- a/popup.js
+++ b/popup.js
@@ -522,6 +522,9 @@ function runThePopup() {
//edit is currently open, use that time
skipTime = getSponsorTimeEditTimes("startTime", index);
+
+ //save the edit
+ saveSponsorTimeEdit(index, false);
}
chrome.tabs.query({
@@ -618,7 +621,7 @@ function runThePopup() {
return parseInt(minutes.value) * 60 + parseFloat(seconds.value);
}
- function saveSponsorTimeEdit(index) {
+ function saveSponsorTimeEdit(index, closeEditMode = true) {
sponsorTimes[index][0] = getSponsorTimeEditTimes("startTime", index);
sponsorTimes[index][1] = getSponsorTimeEditTimes("endTime", index);
@@ -636,9 +639,11 @@ function runThePopup() {
});
});
- displaySponsorTimes();
+ if (closeEditMode) {
+ displaySponsorTimes();
- showSubmitTimesIfNecessary();
+ showSubmitTimesIfNecessary();
+ }
}
//deletes the sponsor time submitted at an index