From 2c76d410ab4ece8163f3492c146454b0b8822e94 Mon Sep 17 00:00:00 2001 From: syuilo <Syuilotan@yahoo.co.jp> Date: Thu, 4 Jul 2019 22:59:52 +0900 Subject: [PATCH] Resolve #1867 --- CHANGELOG.md | 1 + .../app/common/views/components/dialog.vue | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17b622381b..ac5d697be5 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 a577da5a21..ed94fe5f35 100644 --- a/src/client/app/common/views/components/dialog.vue +++ b/src/client/app/common/views/components/dialog.vue @@ -33,7 +33,7 @@ </template> </ui-select> <ui-horizon-group no-grow class="buttons fit-bottom" v-if="!splash && (showOkButton || showCancelButton)"> - <ui-button @click="ok" v-if="showOkButton" primary :autofocus="!input && !select && !user">{{ (showCancelButton || input || select || user) ? $t('@.ok') : $t('@.got-it') }}</ui-button> + <ui-button @click="ok" v-if="showOkButton" primary :autofocus="!input && !select && !user" :disabled="!canOk">{{ (showCancelButton || input || select || user) ? $t('@.ok') : $t('@.got-it') }}</ui-button> <ui-button @click="cancel" v-if="showCancelButton || input || select || user">{{ $t('@.cancel') }}</ui-button> </ui-horizon-group> </template> @@ -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) { -- GitLab