diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-12-06 16:56:24 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-06 16:56:24 +0900 |
| commit | eefeb4c26840572766502878b1dc05cfaf2003cc (patch) | |
| tree | f2dc0d5cc86eba60034610b595266f2e5250a1b8 /src | |
| parent | 10.62.0 (diff) | |
| download | misskey-eefeb4c26840572766502878b1dc05cfaf2003cc.tar.gz misskey-eefeb4c26840572766502878b1dc05cfaf2003cc.tar.bz2 misskey-eefeb4c26840572766502878b1dc05cfaf2003cc.zip | |
#2593 (desktop) (#3518)
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/app/desktop/views/components/post-form.vue | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue index 4abd00dabd..a3c6a8942c 100644 --- a/src/client/app/desktop/views/components/post-form.vue +++ b/src/client/app/desktop/views/components/post-form.vue @@ -36,7 +36,7 @@ </x-draggable> <p class="remain">{{ 4 - files.length }}/4</p> </div> - <mk-poll-editor v-if="poll" ref="poll" @destroyed="poll = false" @updated="saveDraft()"/> + <mk-poll-editor v-if="poll" ref="poll" @destroyed="poll = false" @updated="onPollUpdate()"/> </div> </div> <mk-uploader ref="uploader" @uploaded="attachMedia" @change="onChangeUploadings"/> @@ -109,6 +109,7 @@ export default Vue.extend({ files: [], uploadings: [], poll: false, + pollChoices: [], useCw: false, cw: null, geo: null, @@ -166,7 +167,8 @@ export default Vue.extend({ canPost(): boolean { return !this.posting && (1 <= this.text.length || 1 <= this.files.length || this.poll || this.renote) && - (length(this.text.trim()) <= this.maxNoteTextLength); + (length(this.text.trim()) <= this.maxNoteTextLength) && + (!this.poll || this.pollChoices.length >= 2); } }, @@ -277,6 +279,11 @@ export default Vue.extend({ Array.from((this.$refs.file as any).files).forEach(this.upload); }, + onPollUpdate() { + this.pollChoices = this.$refs.poll.get().choices; + this.saveDraft(); + } + upload(file) { (this.$refs.uploader as any).upload(file); }, |