From 43c2764fcf4b81bf5e8da9db57b67b32bb8315a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 14 Aug 2019 18:05:03 +0200 Subject: [PATCH] Fix mentions and hashtags in editor --- webapp/components/Editor/Editor.vue | 6 ++++-- .../comments/CommentForm/CommentForm.vue | 16 +++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/webapp/components/Editor/Editor.vue b/webapp/components/Editor/Editor.vue index cefd89de4..f54feb292 100644 --- a/webapp/components/Editor/Editor.vue +++ b/webapp/components/Editor/Editor.vue @@ -212,7 +212,8 @@ export default { data() { // Set array of optional extensions by analysing the props. let optionalExtensions = [] - if (this.users && this.users.length) { + // Don't change the following line. The functionallity is in danger! + if (this.users) { optionalExtensions.push( new Mention({ // 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( new Hashtag({ // a list of all suggested items diff --git a/webapp/components/comments/CommentForm/CommentForm.vue b/webapp/components/comments/CommentForm/CommentForm.vue index cf36c1594..d863a7e4d 100644 --- a/webapp/components/comments/CommentForm/CommentForm.vue +++ b/webapp/components/comments/CommentForm/CommentForm.vue @@ -104,14 +104,16 @@ export default { apollo: { User: { query() { - return gql(`{ - User(orderBy: slug_asc) { - id - slug - name - avatar + return gql` + { + User(orderBy: slug_asc) { + id + slug + name + avatar + } } - }`) + ` }, result(result) { this.users = result.data.User