From 20bb851c4e4be3e975a41a66b108170b3318ef37 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 27 May 2018 03:01:08 +0900 Subject: [PATCH] Fix bug --- src/client/app/desktop/views/components/post-form.vue | 11 ++++++++--- src/client/app/mobile/views/components/post-form.vue | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue index 0e0848524a..39bec6cf0c 100644 --- a/src/client/app/desktop/views/components/post-form.vue +++ b/src/client/app/desktop/views/components/post-form.vue @@ -116,9 +116,14 @@ export default Vue.extend({ ast.filter(t => t.type == 'mention').forEach(x => { const mention = x.host ? `@${x.username}@${x.host}` : `@${x.username}`; - if (this.text.indexOf(`${mention} `) == -1) { - this.text += `${mention} `; - } + + // 自分は除外 + if (this.os.i.username == x.username && x.host == null) return; + + // 重複は除外 + if (this.text.indexOf(`${mention} `) != -1) return; + + this.text += `${mention} `; }); } diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue index 55347b7e53..264eb08448 100644 --- a/src/client/app/mobile/views/components/post-form.vue +++ b/src/client/app/mobile/views/components/post-form.vue @@ -84,9 +84,14 @@ export default Vue.extend({ ast.filter(t => t.type == 'mention').forEach(x => { const mention = x.host ? `@${x.username}@${x.host}` : `@${x.username}`; - if (this.text.indexOf(`${mention} `) == -1) { - this.text += `${mention} `; - } + + // 自分は除外 + if (this.os.i.username == x.username && x.host == null) return; + + // 重複は除外 + if (this.text.indexOf(`${mention} `) != -1) return; + + this.text += `${mention} `; }); }