aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/background.ts
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2020-05-10 16:44:53 -0400
committerAjay Ramachandran <[email protected]>2020-05-10 16:44:53 -0400
commit1217b9ed0b5f4013c782c0e839d51ef35f063c05 (patch)
treeeb6a616db58301250e9c65d572f87e3dcb19b5e0 /src/background.ts
parentebf333b8c6e047d61df62a3d279b990e3a938614 (diff)
downloadSponsorBlock-1217b9ed0b5f4013c782c0e839d51ef35f063c05.tar.gz
SponsorBlock-1217b9ed0b5f4013c782c0e839d51ef35f063c05.zip
Added change category button for testing server
Diffstat (limited to 'src/background.ts')
-rw-r--r--src/background.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/background.ts b/src/background.ts
index b204b64c..74382357 100644
--- a/src/background.ts
+++ b/src/background.ts
@@ -47,7 +47,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) {
//this allows the callback to be called later
return true;
case "submitVote":
- submitVote(request.type, request.UUID, callback);
+ submitVote(request.type, request.UUID, request.category, callback);
//this allows the callback to be called later
return true;
@@ -147,7 +147,7 @@ function addSponsorTime(time, videoID, callback) {
});
}
-function submitVote(type, UUID, callback) {
+function submitVote(type, UUID, category, callback) {
let userID = Config.config.userID;
if (userID == undefined || userID === "undefined") {
@@ -156,8 +156,10 @@ function submitVote(type, UUID, callback) {
Config.config.userID = userID;
}
+ let typeSection = (type !== undefined) ? "&type=" + type : "&category=" + category;
+
//publish this vote
- utils.sendRequestToServer("POST", "/api/voteOnSponsorTime?UUID=" + UUID + "&userID=" + userID + "&type=" + type, function(xmlhttp, error) {
+ utils.sendRequestToServer("POST", "/api/voteOnSponsorTime?UUID=" + UUID + "&userID=" + userID + typeSection, function(xmlhttp, error) {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
callback({
successType: 1