]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix user status emoji picking
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Wed, 28 Sep 2022 13:03:42 +0000 (15:03 +0200)
committerSimon L. (Rebase PR Action) <szaimen@e.mail.de>
Wed, 28 Sep 2022 18:42:13 +0000 (18:42 +0000)
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
apps/user_status/src/components/CustomMessageInput.vue
apps/user_status/src/components/SetStatusModal.vue

index d5a25bfb69d7bb439458677e82c9f2c155c1cc1d..da985613506c319d29579c8f6a94415c4abba6d5 100644 (file)
@@ -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)
                },
        },
 }
index e1ba63337ef890b560cd24b61bd2ee12516c45e6..b04af52eefb170b9ff5b2a4a3bef2a84e87f4e76 100644 (file)
                        </div>
                        <div class="set-status-modal__custom-input">
                                <CustomMessageInput ref="customMessageInput"
+                                       :icon="icon"
                                        :message="message"
                                        @change="setMessage"
                                        @submit="saveStatus"
-                                       @iconSelected="setIcon" />
+                                       @select-icon="setIcon" />
                        </div>
                        <PredefinedStatusesList @select-status="selectPredefinedMessage" />
                        <ClearAtSelect :clear-at="clearAt"
 import { showError } from '@nextcloud/dialogs'
 import NcModal from '@nextcloud/vue/dist/Components/NcModal'
 import NcButton from '@nextcloud/vue/dist/Components/NcButton'
-import { getAllStatusOptions } from '../services/statusOptionsService'
-import OnlineStatusMixin from '../mixins/OnlineStatusMixin'
-import PredefinedStatusesList from './PredefinedStatusesList'
-import CustomMessageInput from './CustomMessageInput'
-import ClearAtSelect from './ClearAtSelect'
-import OnlineStatusSelect from './OnlineStatusSelect'
+import { getAllStatusOptions } from '../services/statusOptionsService.js'
+import OnlineStatusMixin from '../mixins/OnlineStatusMixin.js'
+import PredefinedStatusesList from './PredefinedStatusesList.vue'
+import CustomMessageInput from './CustomMessageInput.vue'
+import ClearAtSelect from './ClearAtSelect.vue'
+import OnlineStatusSelect from './OnlineStatusSelect.vue'
 
 export default {
        name: 'SetStatusModal',