mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-19 12:18:51 +00:00
fix(fcv): disallow negative values
This commit is contained in:
parent
61e41b539d
commit
6cb3dcd76a
2 changed files with 5 additions and 2 deletions
|
|
@ -53,7 +53,8 @@ function _requestMaker (user, method, additionalSets = {}) {
|
|||
if (user && user._id && user.apiToken) {
|
||||
request
|
||||
.set('x-api-user', user._id)
|
||||
.set('x-api-key', user.apiToken);
|
||||
.set('x-api-key', user.apiToken)
|
||||
.set('x-client', 'habitica-web');
|
||||
}
|
||||
|
||||
if (!isEmpty(additionalSets)) {
|
||||
|
|
|
|||
|
|
@ -179,7 +179,9 @@ export default {
|
|||
let valid = true;
|
||||
|
||||
for (const stat of canRestore) {
|
||||
if (this.restoreValues.stats[stat] === '') {
|
||||
if (this.restoreValues.stats[stat] === ''
|
||||
|| this.restoreValues.stats[stat] < 0
|
||||
) {
|
||||
this.restoreValues.stats[stat] = this.user.stats[stat];
|
||||
valid = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue