Fix some null-errors

This commit is contained in:
Kasper Rynning-Tønnesen
2020-03-27 16:45:56 +01:00
parent 3b91f9693e
commit 52e773bc7e
2 changed files with 19 additions and 21 deletions

View File

@@ -81,14 +81,9 @@ export default {
!this.pushAllowed ||
localStorage.getItem("push") == null
);
},
todayExists: () => {
return prelottery()
.then(wines => wines.length > 0)
.catch(() => false)
}
},
mounted() {
async mounted() {
this.$on("push-allowed", () => {
this.pushAllowed = true;
});
@@ -96,6 +91,11 @@ export default {
return;
}
this.track();
try {
this.todayExists = (await prelottery()).length > 0;
} catch (e) {
this.todayExists = false;
}
},
methods: {
requestNotificationAccess() {