aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2020-02-08 17:50:06 -0500
committerAjay Ramachandran <[email protected]>2020-02-08 17:50:06 -0500
commit08c7754f291650d5b6265eb0f75ed8387cd7ca64 (patch)
tree73c1d395f9fb29bd2f9b522bd6af635595cdd4d8
parent5f21d3f96fe84a3c9a4b36689a9bda362ad8c894 (diff)
downloadSponsorBlock-08c7754f291650d5b6265eb0f75ed8387cd7ca64.tar.gz
SponsorBlock-08c7754f291650d5b6265eb0f75ed8387cd7ca64.zip
Fixed skip count resetting.
Resolves https://github.com/ajayyy/SponsorBlock/issues/256
-rw-r--r--src/content.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/content.ts b/src/content.ts
index 48ab5afb..9bbf4477 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -636,6 +636,7 @@ function skipToTime(v, index, sponsorTimes, openNotice) {
// Count this as a skip
Config.config.minutesSaved = Config.config.minutesSaved + (sponsorTimes[index][1] - sponsorTimes[index][0]) / 60;
Config.config.skipCount = Config.config.skipCount + 1;
+
sponsorSkipped[index] = true;
}
}
@@ -921,12 +922,10 @@ function vote(type, UUID, skipNotice) {
sponsorSkipped[sponsorIndex] = false;
}
- // Count this as a skip
- Config.config.minutesSaved = Config.config.minutesSaved + factor * (sponsorTimes[sponsorIndex][1] - sponsorTimes[sponsorIndex][0]) / 60;
-
- Config.config.skipCount = 0;
-
- Config.config.skipCount = Config.config.skipCount + factor * 1;
+ // Count this as a skip
+ Config.config.minutesSaved = Config.config.minutesSaved + factor * (sponsorTimes[sponsorIndex][1] - sponsorTimes[sponsorIndex][0]) / 60;
+
+ Config.config.skipCount = Config.config.skipCount + factor;
}
chrome.runtime.sendMessage({