Fixed formatting.

This commit is contained in:
Ajay Ramachandran 2020-01-10 20:49:21 -05:00
parent 9e8a520d1e
commit 4f8e1bc827

View file

@ -130,34 +130,35 @@ function addSponsorTime(time, videoID, callback) {
}
function submitVote(type, UUID, callback) {
let userID = SB.config.userID;
let userID = SB.config.userID;
if (userID == undefined || userID === "undefined") {
//generate one
userID = generateUserID();
SB.config.userID = userID;
if (userID == undefined || userID === "undefined") {
//generate one
userID = generateUserID();
SB.config.userID = userID;
}
//publish this vote
sendRequestToServer("POST", "/api/voteOnSponsorTime?UUID=" + UUID + "&userID=" + userID + "&type=" + type, function(xmlhttp, error) {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
callback({
successType: 1
});
} else if (xmlhttp.readyState == 4 && xmlhttp.status == 405) {
//duplicate vote
callback({
successType: 0,
statusCode: xmlhttp.status
});
} else if (error) {
//error while connect
callback({
successType: -1,
statusCode: xmlhttp.status
});
}
//publish this vote
sendRequestToServer("POST", "/api/voteOnSponsorTime?UUID=" + UUID + "&userID=" + userID + "&type=" + type, function(xmlhttp, error) {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
callback({
successType: 1
});
} else if (xmlhttp.readyState == 4 && xmlhttp.status == 405) {
//duplicate vote
callback({
successType: 0,
statusCode: xmlhttp.status
});
} else if (error) {
//error while connect
callback({
successType: -1,
statusCode: xmlhttp.status
});
}
})
});
}
async function submitTimes(videoID, callback) {