Browse Source

validate bools

modals-to-spa
stingl 4 years ago
parent
commit
60fa1ced20
  1. 7
      js/app.js

7
js/app.js

@ -603,18 +603,24 @@ const TimeTrack = { @@ -603,18 +603,24 @@ const TimeTrack = {
},
timeBoxTimeLeft(ticket) {
return Number(ticket.timeBoxMinutes - this.getTotalTime(ticket, true));
},
validateBooleans(value) {
return value === 'true' || value === true;
}
},
watch: {
publicDB() {
this.publicDB = this.validateBooleans(this.publicDB)
this.updateStorage();
this.$forceUpdate();
},
showPT() {
this.showPT = this.validateBooleans(this.showPT)
this.updateStorage();
this.$forceUpdate();
},
dontShowMinutes() {
this.dontShowMinutes = this.validateBooleans(this.dontShowMinutes)
this.updateStorage();
this.$forceUpdate();
},
@ -623,6 +629,7 @@ const TimeTrack = { @@ -623,6 +629,7 @@ const TimeTrack = {
this.$forceUpdate();
},
fun() {
this.fun = this.validateBooleans(this.fun)
this.updateStorage();
this.$forceUpdate();
}