Fixed skip count resetting.

Resolves https://github.com/ajayyy/SponsorBlock/issues/256
This commit is contained in:
Ajay Ramachandran 2020-02-08 17:50:06 -05:00
parent 5f21d3f96f
commit 08c7754f29

View file

@ -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;
// 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;
Config.config.skipCount = Config.config.skipCount + factor;
}
chrome.runtime.sendMessage({