diff --git a/CHANGELOG.md b/CHANGELOG.md index 17b622381..ac5d697be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ unreleased * AP: attributedTo, to, cc が Array や Object のパターンに対応 * AP: object type が Audio, Document, Image, Page, Video のパターンに対応 * フォロー解除時に確認ダイアログを表示するように +* ユーザー入力ダイアログで、入力時にユーザーの存在を確認するように ### 🐛Fixes * 自分のインスタンスのルートURIへのリンクが無になる問題を修正 diff --git a/src/client/app/common/views/components/dialog.vue b/src/client/app/common/views/components/dialog.vue index a577da5a2..ed94fe5f3 100644 --- a/src/client/app/common/views/components/dialog.vue +++ b/src/client/app/common/views/components/dialog.vue @@ -33,7 +33,7 @@ - {{ (showCancelButton || input || select || user) ? $t('@.ok') : $t('@.got-it') }} + {{ (showCancelButton || input || select || user) ? $t('@.ok') : $t('@.got-it') }} {{ $t('@.cancel') }} @@ -99,11 +99,26 @@ export default Vue.extend({ inputValue: this.input && this.input.default ? this.input.default : null, userInputValue: null, selectedValue: this.select ? this.select.items ? this.select.items[0].value : this.select.groupedItems[0].items[0].value : null, + canOk: true, faTimesCircle, faQuestionCircle }; }, + watch: { + userInputValue() { + if (this.user) { + this.$root.api('users/show', parseAcct(this.userInputValue)).then(u => { + this.canOk = u != null; + }).catch(() => { + this.canOk = false; + }); + } + } + }, + mounted() { + if (this.user) this.canOk = false; + this.$nextTick(() => { (this.$refs.bg as any).style.pointerEvents = 'auto'; anime({ @@ -131,6 +146,7 @@ export default Vue.extend({ methods: { async ok() { + if (!this.canOk) return; if (!this.showOkButton) return; if (this.user) {