From 04190b27d8eb768789d9984f7db37ecd4eb0456b Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Tue, 24 Sep 2019 17:55:07 -0400 Subject: [PATCH] Made it ignore rate limits for voting. --- content.js | 4 ++-- popup.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/content.js b/content.js index fb0b13b0..b41bf2fe 100644 --- a/content.js +++ b/content.js @@ -879,8 +879,8 @@ function vote(type, UUID, skipNotice) { if (response != undefined) { //see if it was a success or failure if (skipNotice != null) { - if (response.successType == 1) { - //success + if (response.successType == 1 || (response.successType == -1 && response.statusCode == 429)) { + //success (treat rate limits as a success) if (type == 0) { skipNotice.afterDownvote.bind(skipNotice)(); } diff --git a/popup.js b/popup.js index 3476747a..a7b3a41a 100644 --- a/popup.js +++ b/popup.js @@ -1102,8 +1102,8 @@ function runThePopup() { }, function(response) { if (response != undefined) { //see if it was a success or failure - if (response.successType == 1) { - //success + if (response.successType == 1 || (response.successType == -1 && response.statusCode == 429)) { + //success (treat rate limits as a success) addVoteMessage(chrome.i18n.getMessage("voted"), UUID) } else if (response.successType == 0) { //failure: duplicate vote