diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-12-07 18:33:09 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-07 18:33:09 +0900 |
| commit | 96571866a3626e823ad3efe82f2ef1e0deba3f26 (patch) | |
| tree | 09e47cf9962fc50e5b8f961293faa118ed05a544 /src | |
| parent | Update parser.ts (diff) | |
| download | misskey-96571866a3626e823ad3efe82f2ef1e0deba3f26.tar.gz misskey-96571866a3626e823ad3efe82f2ef1e0deba3f26.tar.bz2 misskey-96571866a3626e823ad3efe82f2ef1e0deba3f26.zip | |
#2593 (mobile) (#3521)
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/app/mobile/views/components/post-form.vue | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue index 69858f9ceb..52bb5f966a 100644 --- a/src/client/app/mobile/views/components/post-form.vue +++ b/src/client/app/mobile/views/components/post-form.vue @@ -28,7 +28,7 @@ </div> </x-draggable> </div> - <mk-poll-editor v-if="poll" ref="poll" @destroyed="poll = false"/> + <mk-poll-editor v-if="poll" ref="poll" @destroyed="poll = false" @updated="onPollUpdate()"/> <mk-uploader ref="uploader" @uploaded="attachMedia" @change="onChangeUploadings"/> <footer> <button class="upload" @click="chooseFile"><fa icon="upload"/></button> @@ -101,6 +101,7 @@ export default Vue.extend({ uploadings: [], files: [], poll: false, + pollChoices: [], geo: null, visibility: 'public', visibleUsers: [], @@ -156,7 +157,8 @@ export default Vue.extend({ canPost(): boolean { return !this.posting && (1 <= this.text.length || 1 <= this.files.length || this.poll || this.renote) && - (this.text.trim().length <= this.maxNoteTextLength); + (this.text.trim().length <= this.maxNoteTextLength) && + (!this.poll || this.pollChoices.length >= 2); } }, @@ -257,6 +259,10 @@ export default Vue.extend({ Array.from((this.$refs.file as any).files).forEach(this.upload); }, + onPollUpdate() { + this.pollChoices = this.$refs.poll.get().choices; + }, + upload(file) { (this.$refs.uploader as any).upload(file); }, |