fixed bug, sodass user, dessen autolock vom finanzer abgestellt ist, soviel anschreiben können wie sie wollen

This commit is contained in:
Tim Gröger 2020-06-23 22:00:54 +02:00
parent 65decabfb5
commit d6651046d8
3 changed files with 10 additions and 7 deletions

View File

@ -362,7 +362,8 @@ export default {
this.overLimitUser = null this.overLimitUser = null
}, },
checkOverLimitIsValid(user) { checkOverLimitIsValid(user) {
if (user.toSetAmount) { console.log(user)
if (user.toSetAmount && user.autoLock) {
if ( if (
Math.abs(user.amount - Number.parseInt(user.toSetAmount)) > Math.abs(user.amount - Number.parseInt(user.toSetAmount)) >
user.limit + 500 user.limit + 500
@ -387,7 +388,7 @@ export default {
clearTimeout(user.timeout) clearTimeout(user.timeout)
user.toSetAmount = user.toSetAmount ? user.toSetAmount + amount : amount user.toSetAmount = user.toSetAmount ? user.toSetAmount + amount : amount
if (this.checkOverLimitIsValid(user)) { if (this.checkOverLimitIsValid(user)) {
if (this.checkOverLimit(user)) { if (this.checkOverLimit(user) && user.autoLock) {
this.overLimitUser = user this.overLimitUser = user
} else { } else {
user.timeout = setTimeout(() => { user.timeout = setTimeout(() => {
@ -437,7 +438,7 @@ export default {
? user.toSetAmount + Math.round(Math.abs(user.value * 100)) ? user.toSetAmount + Math.round(Math.abs(user.value * 100))
: Math.round(Math.abs(user.value * 100)) : Math.round(Math.abs(user.value * 100))
if (this.checkOverLimitIsValid(user)) { if (this.checkOverLimitIsValid(user)) {
if (this.checkOverLimit(user)) { if (this.checkOverLimit(user) && user.autoLock) {
this.overLimitUser = user this.overLimitUser = user
} else { } else {
this.addAmount({ this.addAmount({

View File

@ -314,7 +314,7 @@ export default {
this.overLimitUser = null this.overLimitUser = null
}, },
checkOverLimitIsValid(user) { checkOverLimitIsValid(user) {
if (this.toSetAmount) { if (this.toSetAmount && user.autoLock) {
if (Math.abs(this.getAllSum() - Number.parseInt(this.toSetAmount)) > user.limit + 500) { if (Math.abs(this.getAllSum() - Number.parseInt(this.toSetAmount)) > user.limit + 500) {
this.overOverLimit = user this.overOverLimit = user
this.toSetAmount = null this.toSetAmount = null
@ -336,7 +336,7 @@ export default {
clearTimeout(this.timeout) clearTimeout(this.timeout)
this.toSetAmount = this.toSetAmount ? this.toSetAmount + amount : amount this.toSetAmount = this.toSetAmount ? this.toSetAmount + amount : amount
if (this.checkOverLimitIsValid(this.user)) { if (this.checkOverLimitIsValid(this.user)) {
if (this.checkOverLimit(this.user)) { if (this.checkOverLimit(this.user) && this.user.autoLock) {
this.overLimitUser = this.user this.overLimitUser = this.user
} else { } else {
this.timeout = setTimeout(() => { this.timeout = setTimeout(() => {
@ -389,7 +389,7 @@ export default {
? this.toSetAmount + Math.round(Math.abs(this.value * 100)) ? this.toSetAmount + Math.round(Math.abs(this.value * 100))
: Math.round(Math.abs(this.value * 100)) : Math.round(Math.abs(this.value * 100))
if (this.checkOverLimitIsValid(this.user)) { if (this.checkOverLimitIsValid(this.user)) {
if (this.checkOverLimit(this.user)) { if (this.checkOverLimit(this.user) && this.user.autoLock) {
this.overLimitUser = this.user this.overLimitUser = this.user
} }
else { else {

View File

@ -45,6 +45,7 @@ const mutations = {
existuser.type = users[user].type existuser.type = users[user].type
existuser.limit = users[user].limit existuser.limit = users[user].limit
existuser.last_seen = users[user].last_seen existuser.last_seen = users[user].last_seen
existuser.autoLock = users[user].autoLock ? users[user].autoLock : existuser.autoLock
} else { } else {
state.users.push({ state.users.push({
username: users[user].username, username: users[user].username,
@ -55,7 +56,8 @@ const mutations = {
type: users[user].type, type: users[user].type,
loading: false, loading: false,
limit: users[user].limit, limit: users[user].limit,
last_seen: users[user].last_seen last_seen: users[user].last_seen,
autoLock: users[user].autoLock
}) })
} }
} }