From c8d1e2672e2d65a505f3c6c93042d91358519d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=83=D8=A7=D8=B1=D9=84=20=D9=85=D8=A8=D8=A7=D8=B1=D9=83?= Date: Tue, 13 Jul 2021 16:50:25 +0200 Subject: [PATCH] protect router from creating new straeams - fixed --- front/src/App.vue | 2 +- front/src/components/Content/index.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/App.vue b/front/src/App.vue index 1c2c0ab..6039533 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -46,7 +46,7 @@ export default { this.$store.commit("setTopics", []); this.$store.commit("setRules", []); this.$store.commit("setCurStream", to.path.replace("/", "")); - if (this.currentStream != "" && this.streams.includes(this.currentStream)) { + if (this.currentStream != "" && this.streams.find(s => s.name == this.currentStream)) { this.setUpDoc(this.currentStream); } }); diff --git a/front/src/components/Content/index.vue b/front/src/components/Content/index.vue index 9f3621b..64078b6 100644 --- a/front/src/components/Content/index.vue +++ b/front/src/components/Content/index.vue @@ -24,7 +24,7 @@ export default { ...mapState(["currentStream", "streams"]), ...mapGetters(["sortedTopics"]), title() { - return this.streams.includes(this.currentStream) ? + return this.streams.find(s => s.name == this.currentStream) ? this.currentStream.replace("pub-", "") : 'Stream does not exist.' }