Default color val is null, stricter localWinners statement.

This commit is contained in:
2020-03-10 19:03:22 +01:00
parent fc3b9d3eb5
commit 056ae43733

View File

@@ -127,10 +127,10 @@
components: { TextToast, Wine, ScanToVinmonopolet },
data() {
return {
red: 0,
blue: 0,
green: 0,
yellow: 0,
red: null,
blue: null,
green: null,
yellow: null,
payed: undefined,
winners: [],
wines: [],
@@ -310,7 +310,7 @@
}
let localWinners = localStorage.getItem("winners");
if (localWinners) {
if (localWinners && this.winners.length) {
localWinners = JSON.parse(localWinners);
this.winners = this.winners.map(winner => {