Fix editing not adding numbers.

Resolves https://github.com/ajayyy/SponsorBlock/issues/273.
This commit is contained in:
Ajay Ramachandran 2020-02-10 18:03:09 -05:00
parent 852912a42b
commit d2779aba86

View file

@ -667,11 +667,11 @@ async function runThePopup(messageListener?: MessageListener) {
//id start name is whether it is the startTime or endTime //id start name is whether it is the startTime or endTime
//gives back the time in seconds //gives back the time in seconds
function getSponsorTimeEditTimes(idStartName, index) { function getSponsorTimeEditTimes(idStartName, index): number {
let minutes = <HTMLInputElement> <unknown> document.getElementById(idStartName + "Minutes" + index); let minutes = <HTMLInputElement> <unknown> document.getElementById(idStartName + "Minutes" + index);
let seconds = <HTMLInputElement> <unknown> document.getElementById(idStartName + "Seconds" + index); let seconds = <HTMLInputElement> <unknown> document.getElementById(idStartName + "Seconds" + index);
return parseInt(minutes.value) * 60 + seconds.value; return parseInt(minutes.value) * 60 + parseInt(seconds.value);
} }
function saveSponsorTimeEdit(index, closeEditMode = true) { function saveSponsorTimeEdit(index, closeEditMode = true) {
@ -680,6 +680,7 @@ async function runThePopup(messageListener?: MessageListener) {
//save this //save this
Config.config.sponsorTimes.set(currentVideoID, sponsorTimes); Config.config.sponsorTimes.set(currentVideoID, sponsorTimes);
messageHandler.query({ messageHandler.query({
active: true, active: true,
currentWindow: true currentWindow: true