summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-05-27 03:01:08 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-05-27 03:01:08 +0900
commit20bb851c4e4be3e975a41a66b108170b3318ef37 (patch)
tree7f31c3edbb4fd8b07e9cc50c40fd54512f619cd2
parentRefactor (diff)
downloadsharkey-20bb851c4e4be3e975a41a66b108170b3318ef37.tar.gz
sharkey-20bb851c4e4be3e975a41a66b108170b3318ef37.tar.bz2
sharkey-20bb851c4e4be3e975a41a66b108170b3318ef37.zip
Fix bug
-rw-r--r--src/client/app/desktop/views/components/post-form.vue11
-rw-r--r--src/client/app/mobile/views/components/post-form.vue11
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} `;
});
}