From ba0560607414d1f7db06960d2e936e9b3fb2fa91 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Thu, 27 Dec 2018 19:58:57 +0900 Subject: Show on the CW button that there is a poll (#3769) --- src/client/app/common/views/components/cw-button.vue | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/client/app/common') diff --git a/src/client/app/common/views/components/cw-button.vue b/src/client/app/common/views/components/cw-button.vue index 034848a116..098aa021d1 100644 --- a/src/client/app/common/views/components/cw-button.vue +++ b/src/client/app/common/views/components/cw-button.vue @@ -1,11 +1,7 @@ @@ -13,6 +9,7 @@ import Vue from 'vue'; import i18n from '../../../i18n'; import { length } from 'stringz'; +import { concat } from '../../../../../prelude/array'; export default Vue.extend({ i18n: i18n('common/views/components/cw-button.vue'), @@ -28,6 +25,16 @@ export default Vue.extend({ } }, + computed: { + label(): string { + return concat([ + this.note.text ? [this.$t('chars', { count: length(this.note.text) })] : [], + this.note.files && this.note.files.length !== 0 ? [this.$t('files', { count: this.note.files.length }) ] : [], + this.note.poll != null ? [this.$t('poll')] : [] + ] as string[][]).join(' / '); + } + }, + methods: { length, -- cgit v1.2.3-freya