Skip to content
This repository was archived by the owner on Feb 14, 2022. It is now read-only.

Commit 1df61b0

Browse files
committed
Display error message when vote failed
1 parent da8c6da commit 1df61b0

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function initializeVoting(token, problemId, votedFlag) {
6464
const func = "var params={'token':'"+token+"','id':"+problemId+",'level':"+i+"};" +
6565
"var o=new XMLHttpRequest;" +
6666
"o.open('POST','https://api.solved.ac/vote_difficulty.php',!0)," +
67-
"o.onload=function(){o.status>=200&&o.status<400&&location.reload()}," +
67+
"o.onload=function(){(o.status>=200&&o.status<400&&location.reload())||(alert(JSON.parse(o.responseText).error))}," +
6868
"o.send(JSON.stringify(params))";
6969
difficultySection.innerHTML += "<span onclick=\"" + func + "\">" + levelLabel(i) + "</a>";
7070
if (i % 5 == 0) difficultySection.innerHTML += "<br>";

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "solved.ac",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "Problem difficulty informations for BOJ",
55
"manifest_version": 2,
66
"author": "shiftpsh",

0 commit comments

Comments
 (0)