From 21fd2d83171487032a0476e91ee49f2f2f094eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 28 Sep 2022 15:03:42 +0200 Subject: [PATCH] Fix user status emoji picking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- .../src/components/CustomMessageInput.vue | 13 +++++++++++-- .../user_status/src/components/SetStatusModal.vue | 15 ++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/apps/user_status/src/components/CustomMessageInput.vue b/apps/user_status/src/components/CustomMessageInput.vue index d5a25bfb69d..da985613506 100644 --- a/apps/user_status/src/components/CustomMessageInput.vue +++ b/apps/user_status/src/components/CustomMessageInput.vue @@ -48,11 +48,17 @@ import NcEmojiPicker from '@nextcloud/vue/dist/Components/NcEmojiPicker.js' export default { name: 'CustomMessageInput', + components: { NcButton, NcEmojiPicker, }, + props: { + icon: { + type: String, + default: '😀', + }, message: { type: String, required: true, @@ -63,11 +69,13 @@ export default { default: false, }, }, + emits: [ 'change', 'submit', 'icon-selected', ], + computed: { /** * Returns the user-set icon or a smiley in case no icon is set @@ -78,6 +86,7 @@ export default { return this.icon || '😀' }, }, + methods: { focus() { this.$refs.input.focus() @@ -96,8 +105,8 @@ export default { this.$emit('submit', event.target.value) }, - setIcon(event) { - this.$emit('icon-selected', event) + setIcon(icon) { + this.$emit('select-icon', icon) }, }, } diff --git a/apps/user_status/src/components/SetStatusModal.vue b/apps/user_status/src/components/SetStatusModal.vue index e1ba63337ef..b04af52eefb 100644 --- a/apps/user_status/src/components/SetStatusModal.vue +++ b/apps/user_status/src/components/SetStatusModal.vue @@ -42,10 +42,11 @@
+ @select-icon="setIcon" />