protect router from creating new straeams
This commit is contained in:
parent
52c02bc8e4
commit
d45aac7de3
9 changed files with 57 additions and 9 deletions
36
front/package-lock.json
generated
36
front/package-lock.json
generated
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "front",
|
"name": "Chattypub",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
|
|
@ -10107,6 +10107,40 @@
|
||||||
"unpipe": "1.0.0"
|
"unpipe": "1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"raw-loader": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"loader-utils": "^2.0.0",
|
||||||
|
"schema-utils": "^3.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"loader-utils": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"big.js": "^5.2.2",
|
||||||
|
"emojis-list": "^3.0.0",
|
||||||
|
"json5": "^2.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"schema-utils": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-tTEaeYkyIhEZ9uWgAjDerWov3T9MgX8dhhy2r0IGeeX4W8ngtGl1++dUve/RUqzuaASSh7shwCDJjEzthxki8w==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/json-schema": "^7.0.7",
|
||||||
|
"ajv": "^6.12.5",
|
||||||
|
"ajv-keywords": "^3.5.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"read-pkg": {
|
"read-pkg": {
|
||||||
"version": "5.2.0",
|
"version": "5.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz",
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["isMobile", "pubStr", "currentStream"]),
|
...mapState(["isMobile", "pubStr", "currentStream", "streams"]),
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$store.commit("setMobile", this.checkIfMobile());
|
this.$store.commit("setMobile", this.checkIfMobile());
|
||||||
|
|
@ -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 != "") {
|
if (this.currentStream != "" && this.streams.includes(this.currentStream)) {
|
||||||
this.setUpDoc(this.currentStream);
|
this.setUpDoc(this.currentStream);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.7 KiB |
|
|
@ -38,7 +38,8 @@ export default {
|
||||||
return r;
|
return r;
|
||||||
},
|
},
|
||||||
messagesToShow() {
|
messagesToShow() {
|
||||||
return this.topic.messages.filter(m => !m.responseTo)
|
return this.topic.messages
|
||||||
|
.filter(m => !m.responseTo)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,14 @@ export default {
|
||||||
m.responseTo.sender_id == this.message.sender_id &&
|
m.responseTo.sender_id == this.message.sender_id &&
|
||||||
this.message.content.includes(m.responseTo.quote)
|
this.message.content.includes(m.responseTo.quote)
|
||||||
);
|
);
|
||||||
|
console.log(c, referrers)
|
||||||
referrers.forEach((m) => {
|
referrers.forEach((m) => {
|
||||||
const classes = m.reactions.map((r) => "u" + r.emoji_code).join(" ");
|
const classes = m.reactions.map((r) => "u" + r.emoji_code).join(" ");
|
||||||
c = c.replace(
|
c = c.replace(
|
||||||
m.responseTo.quote,
|
m.responseTo.quote,
|
||||||
`<span class="${classes}">${m.responseTo.quote}</span>`
|
`<span class="${classes}">${m.responseTo.quote}</span>`
|
||||||
);
|
);
|
||||||
|
console.log(c)
|
||||||
});
|
});
|
||||||
return c;
|
return c;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<section id="content" :class="['content', currentStream]">
|
<section id="content" :class="['content', currentStream]">
|
||||||
<h1 class="title">{{ currentStream.replace("pub-", "") }}</h1>
|
<h1 class="title">{{ title }}</h1>
|
||||||
<Chapter
|
<Chapter
|
||||||
v-for="topic in sortedTopics"
|
v-for="topic in sortedTopics"
|
||||||
:key="topic.title"
|
:key="topic.title"
|
||||||
|
|
@ -21,8 +21,13 @@ export default {
|
||||||
Chapter,
|
Chapter,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["currentStream"]),
|
...mapState(["currentStream", "streams"]),
|
||||||
...mapGetters(["sortedTopics"]),
|
...mapGetters(["sortedTopics"]),
|
||||||
|
title() {
|
||||||
|
return this.streams.includes(this.currentStream) ?
|
||||||
|
this.currentStream.replace("pub-", "") : 'Stream does not exist.'
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {},
|
methods: {},
|
||||||
props: ["print", "show_message_data"],
|
props: ["print", "show_message_data"],
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,11 @@ export default createRouter({
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
component: Home,
|
component: Home,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/docs',
|
||||||
|
name: 'Docs',
|
||||||
|
component: Docs,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/:pathMatch(.*)*',
|
path: '/:pathMatch(.*)*',
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,9 @@ const handleHTMLReply = message => {
|
||||||
quote: message.content
|
quote: message.content
|
||||||
.replace(/.*[^]+<\/p>\n<blockquote>\n<p>/gm, '')
|
.replace(/.*[^]+<\/p>\n<blockquote>\n<p>/gm, '')
|
||||||
.replace(/<\/p>\n<\/blockquote>/gm, '')
|
.replace(/<\/p>\n<\/blockquote>/gm, '')
|
||||||
|
// .replace(/\n/gm, '')
|
||||||
}
|
}
|
||||||
// console.log(message.responseTo)
|
console.log(message.responseTo)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default createStore({
|
export default createStore({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue