Skip to content

Commit 0c78f21

Browse files
committed
Fix user status emoji picking
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
1 parent 5c8cab6 commit 0c78f21

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

apps/user_status/src/components/CustomMessageInput.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,17 @@ import NcEmojiPicker from '@nextcloud/vue/dist/Components/NcEmojiPicker.js'
4848
4949
export default {
5050
name: 'CustomMessageInput',
51+
5152
components: {
5253
NcButton,
5354
NcEmojiPicker,
5455
},
56+
5557
props: {
58+
icon: {
59+
type: String,
60+
default: '😀',
61+
},
5662
message: {
5763
type: String,
5864
required: true,
@@ -63,11 +69,13 @@ export default {
6369
default: false,
6470
},
6571
},
72+
6673
emits: [
6774
'change',
6875
'submit',
6976
'icon-selected',
7077
],
78+
7179
computed: {
7280
/**
7381
* Returns the user-set icon or a smiley in case no icon is set
@@ -78,6 +86,7 @@ export default {
7886
return this.icon || '😀'
7987
},
8088
},
89+
8190
methods: {
8291
focus() {
8392
this.$refs.input.focus()
@@ -96,8 +105,8 @@ export default {
96105
this.$emit('submit', event.target.value)
97106
},
98107
99-
setIcon(event) {
100-
this.$emit('icon-selected', event)
108+
setIcon(icon) {
109+
this.$emit('select-icon', icon)
101110
},
102111
},
103112
}

apps/user_status/src/components/SetStatusModal.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@
4242
</div>
4343
<div class="set-status-modal__custom-input">
4444
<CustomMessageInput ref="customMessageInput"
45+
:icon="icon"
4546
:message="message"
4647
@change="setMessage"
4748
@submit="saveStatus"
48-
@iconSelected="setIcon" />
49+
@select-icon="setIcon" />
4950
</div>
5051
<PredefinedStatusesList @select-status="selectPredefinedMessage" />
5152
<ClearAtSelect :clear-at="clearAt"
@@ -74,12 +75,12 @@
7475
import { showError } from '@nextcloud/dialogs'
7576
import NcModal from '@nextcloud/vue/dist/Components/NcModal'
7677
import NcButton from '@nextcloud/vue/dist/Components/NcButton'
77-
import { getAllStatusOptions } from '../services/statusOptionsService'
78-
import OnlineStatusMixin from '../mixins/OnlineStatusMixin'
79-
import PredefinedStatusesList from './PredefinedStatusesList'
80-
import CustomMessageInput from './CustomMessageInput'
81-
import ClearAtSelect from './ClearAtSelect'
82-
import OnlineStatusSelect from './OnlineStatusSelect'
78+
import { getAllStatusOptions } from '../services/statusOptionsService.js'
79+
import OnlineStatusMixin from '../mixins/OnlineStatusMixin.js'
80+
import PredefinedStatusesList from './PredefinedStatusesList.vue'
81+
import CustomMessageInput from './CustomMessageInput.vue'
82+
import ClearAtSelect from './ClearAtSelect.vue'
83+
import OnlineStatusSelect from './OnlineStatusSelect.vue'
8384
8485
export default {
8586
name: 'SetStatusModal',

0 commit comments

Comments
 (0)