Skip to content

Commit

Permalink
#92, store and display comment enabled config var correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
thrize committed Apr 14, 2018
1 parent 3bf451d commit 476e705
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion public/js/edit-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ function setupConfigVars() {
var elementId = "input_field_" + i;
var element = document.getElementById(elementId);
if (element) {
element.value = data[fieldNames[i]];
// Adding as exception to the rule
if (i === 19) { // checkbox COMMENT_ENABLED
element.checked = data[fieldNames[i]] === 'on';
} else {
element.value = data[fieldNames[i]];
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ app.get("/edit-config", function(req, res) {
change = true;
html_title += "Updated POST_METADATA_MAX_RUNS_TO_KEEP";
} else if (req.query.COMMENT_ENABLED) {
configVars.COMMENT_ENABLED = atob(req.query.COMMENT_ENABLED).localeCompare('on');
configVars.COMMENT_ENABLED = atob(req.query.COMMENT_ENABLED).localeCompare('on') ? 'on' : 'off';
change = true;
html_title += "Updated COMMENT_ENABLED";
}
Expand Down

0 comments on commit 476e705

Please sign in to comment.