Skip to content

Commit

Permalink
Redirect to issues page on down vote
Browse files Browse the repository at this point in the history
* Save a click and encourage those downvoting to do something about it.

Applies to OpenUserJS#262 ... treads on OpenUserJS#262 (comment)
  • Loading branch information
Martii committed Mar 13, 2016
1 parent 7396cac commit de4b8f5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion controllers/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,16 @@ exports.vote = function (aReq, aRes, aNext) {
function saveScript() {
if (!flags) {
aScript.save(function (aErr, aScript) {
aRes.redirect(uri);
var script = null;

if (vote === false) {
script = modelParser.parseScript(aScript);

// Gently encourage browsing/creating an issue with a down vote
aRes.redirect(script.scriptIssuesPageUri);
} else {
aRes.redirect(uri);
}
});
return;
}
Expand Down

0 comments on commit de4b8f5

Please sign in to comment.