mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 01:01:55 +01:00
Fixed error messages not working. Added message for error 503 and 0.
This commit is contained in:
parent
108aac0e79
commit
6790952f86
3 changed files with 15 additions and 4 deletions
|
@ -262,5 +262,8 @@
|
|||
},
|
||||
"keybindDescriptionComplete": {
|
||||
"message": "The keybind has been set to: "
|
||||
},
|
||||
"0": {
|
||||
"message": "Connection Timeout. Check your internet connection. If your internet is working, the server is probably overloaded or down."
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1041,8 +1041,11 @@ function sendSubmitMessage(){
|
|||
document.getElementById("submitButton").style.animation = "unset";
|
||||
document.getElementById("submitImage").src = chrome.extension.getURL("icons/PlayerUploadFailedIconSponsorBlocker256px.png");
|
||||
|
||||
if([400,429,409,502].includes(response.statusCode)) {
|
||||
alert(chrome.i18n.getMessage(response.statusCode));
|
||||
if([400, 429, 409, 502, 0].includes(response.statusCode)) {
|
||||
//treat them the same
|
||||
if (response.statusCode == 503) response.statusCode = 502;
|
||||
|
||||
alert(chrome.i18n.getMessage(response.statusCode + ""));
|
||||
} else {
|
||||
alert(chrome.i18n.getMessage("connectionError") + response.statusCode);
|
||||
}
|
||||
|
|
9
popup.js
9
popup.js
|
@ -811,8 +811,11 @@ function runThePopup() {
|
|||
} else {
|
||||
let errorMessage = "";
|
||||
|
||||
if([400,429,409,502].includes(response.statusCode)) {
|
||||
errorMessage = chrome.i18n.getMessage(response.statusCode);
|
||||
if([400, 429, 409, 502, 0].includes(response.statusCode)) {
|
||||
//treat them the same
|
||||
if (response.statusCode == 503) response.statusCode = 502;
|
||||
|
||||
errorMessage = chrome.i18n.getMessage(response.statusCode + "");
|
||||
} else {
|
||||
errorMessage = chrome.i18n.getMessage("connectionError") + response.statusCode;
|
||||
}
|
||||
|
@ -1109,8 +1112,10 @@ function runThePopup() {
|
|||
type: type,
|
||||
UUID: UUID
|
||||
}, function(response) {
|
||||
console.log(response)
|
||||
if (response != undefined) {
|
||||
//see if it was a success or failure
|
||||
console.log(response)
|
||||
if (response.successType == 1 || (response.successType == -1 && response.statusCode == 429)) {
|
||||
//success (treat rate limits as a success)
|
||||
addVoteMessage(chrome.i18n.getMessage("voted"), UUID)
|
||||
|
|
Loading…
Reference in a new issue