Fix mentions and hashtags in editor

This commit is contained in:
Wolfgang Huß 2019-08-14 18:05:03 +02:00
parent c5ff3b5c6d
commit 43c2764fcf
2 changed files with 13 additions and 9 deletions

View File

@ -212,7 +212,8 @@ export default {
data() { data() {
// Set array of optional extensions by analysing the props. // Set array of optional extensions by analysing the props.
let optionalExtensions = [] let optionalExtensions = []
if (this.users && this.users.length) { // Don't change the following line. The functionallity is in danger!
if (this.users) {
optionalExtensions.push( optionalExtensions.push(
new Mention({ new Mention({
// a list of all suggested items // a list of all suggested items
@ -287,7 +288,8 @@ export default {
}), }),
) )
} }
if (this.hashtags && this.hashtags.length) { // Don't change the following line. The functionallity is in danger!
if (this.hashtags) {
optionalExtensions.push( optionalExtensions.push(
new Hashtag({ new Hashtag({
// a list of all suggested items // a list of all suggested items

View File

@ -104,14 +104,16 @@ export default {
apollo: { apollo: {
User: { User: {
query() { query() {
return gql(`{ return gql`
User(orderBy: slug_asc) { {
id User(orderBy: slug_asc) {
slug id
name slug
avatar name
avatar
}
} }
}`) `
}, },
result(result) { result(result) {
this.users = result.data.User this.users = result.data.User