fix(frontend): adds null checks re #190

This commit is contained in:
Dimitrie Stefanescu
2021-04-23 21:23:35 +01:00
parent 73849fd5d7
commit 00a48a05ec
2 changed files with 8 additions and 4 deletions
+6 -3
View File
@@ -71,10 +71,11 @@
<router-view></router-view>
<v-snackbar v-model="streamSnackbar" :timeout="5000" color="primary" absolute right top>
New stream
<i v-if="streamSnackbarInfo.name">{{ streamSnackbarInfo.name }}</i>
<i v-if="streamSnackbarInfo && streamSnackbarInfo.name">{{ streamSnackbarInfo.name }}</i>
<span v-else>available</span>
<template #action="{ attrs }">
<v-btn
v-if="streamSnackbarInfo"
text
v-bind="attrs"
:to="'/streams/' + streamSnackbarInfo.id"
@@ -139,8 +140,10 @@ export default {
}
`,
result(streamInfo) {
this.streamSnackbar = true
this.streamSnackbarInfo = streamInfo.data.userStreamAdded
if (streamInfo.data.userStreamAdded) {
this.streamSnackbar = true
this.streamSnackbarInfo = streamInfo.data.userStreamAdded
}
}
}
}
+2 -1
View File
@@ -80,7 +80,7 @@ export default {
id: this.$route.params.streamId
}
},
result() {
result(info) {
this.$apollo.queries.stream.refetch()
}
},
@@ -96,6 +96,7 @@ export default {
}
},
result(commitInfo) {
if (!commitInfo.data.commitCreated) return
this.commitSnackbar = true
this.commitSnackbarInfo = commitInfo.data.commitCreated
}