Added dagens fangst link to virtual lottery game page.

This commit is contained in:
2020-03-20 13:47:33 +01:00
parent 49b4594f8f
commit e51e6598a7
2 changed files with 52 additions and 11 deletions

View File

@@ -52,6 +52,7 @@ import Banner from "@/ui/Banner";
import Wines from "@/ui/Wines";
import Vipps from "@/ui/Vipps";
import Countdown from "@/ui/Countdown";
import { prelottery } from "@/api";
export default {
components: {
@@ -67,7 +68,6 @@ export default {
data() {
return {
hardStart: false,
todayExists: false,
pushAllowed: false
};
},
@@ -81,21 +81,17 @@ export default {
!this.pushAllowed ||
localStorage.getItem("push") == null
);
},
todayExists: () => {
return prelottery()
.then(wines => wines.length > 0)
.catch(() => false)
}
},
mounted() {
this.$on("push-allowed", () => {
this.pushAllowed = true;
});
fetch("/api/wines/prelottery")
.then(wines => wines.json())
.then(wines => {
if (wines.length > 0) {
this.todayExists = true;
} else {
this.todayExists = false;
}
});
if (window.location.hostname == "localhost") {
return;
}