@@ -59,7 +106,7 @@ import gql from 'graphql-tag' export default { - name: 'SettingsGeneral', + name: 'StreamSettings', components: { BreadcrumbTitle: () => import('@/components/BreadcrumbTitle') }, @@ -95,6 +142,8 @@ export default { loading: false, valid: false, name: null, + deleteDialog: false, + streamNameConfirm: '', description: null, isPublic: true, validation: { @@ -139,6 +188,25 @@ export default { this.$apollo.queries.stream.refetch() this.loading = false + }, + async deleteStream() { + this.$matomo && this.$matomo.trackPageView('stream/delete') + try { + await this.$apollo.mutate({ + mutation: gql` + mutation deleteStream($id: String!) { + streamDelete(id: $id) + } + `, + variables: { + id: this.stream.id + } + }) + } catch (e) { + console.log(e) + } + this.deleteDialog = false + this.$router.push({ path: '/streams' }) } } }