protect router from creating new straeams - fixed

This commit is contained in:
كارل مبارك 2021-07-13 16:50:25 +02:00
parent d45aac7de3
commit c8d1e2672e
2 changed files with 2 additions and 2 deletions

View file

@ -46,7 +46,7 @@ export default {
this.$store.commit("setTopics", []); this.$store.commit("setTopics", []);
this.$store.commit("setRules", []); this.$store.commit("setRules", []);
this.$store.commit("setCurStream", to.path.replace("/", "")); 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); this.setUpDoc(this.currentStream);
} }
}); });

View file

@ -24,7 +24,7 @@ export default {
...mapState(["currentStream", "streams"]), ...mapState(["currentStream", "streams"]),
...mapGetters(["sortedTopics"]), ...mapGetters(["sortedTopics"]),
title() { title() {
return this.streams.includes(this.currentStream) ? return this.streams.find(s => s.name == this.currentStream) ?
this.currentStream.replace("pub-", "") : 'Stream does not exist.' this.currentStream.replace("pub-", "") : 'Stream does not exist.'
} }