mirror of https://github.com/calzoneman/sync.git
Change skipratio fallback to error response
This commit is contained in:
parent
d93e42a71c
commit
ab1358df36
|
@ -114,10 +114,17 @@ OptionsModule.prototype.handleSetOptions = function (user, data) {
|
|||
if ("voteskip_ratio" in data) {
|
||||
var ratio = parseFloat(data.voteskip_ratio);
|
||||
if (isNaN(ratio) || ratio < 0) {
|
||||
ratio = 0.5;
|
||||
}
|
||||
user.socket.emit("validationError", {
|
||||
target: "#cs-voteskip_ratio",
|
||||
message: "Input must be a number 0 or greater. 1.0 is 100%."
|
||||
});
|
||||
} else {
|
||||
this.opts.voteskip_ratio = ratio;
|
||||
sendUpdate = true;
|
||||
user.socket.emit("validationPassed", {
|
||||
target: "#cs-voteskip_ratio"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if ("afk_timeout" in data) {
|
||||
|
|
Loading…
Reference in New Issue