Browse Source

Don't overwrite certain values if the refreshing comes in via short updates

This e.g. happens from the talk participant list which only has the status, message and icon.
Due to the overwriting e.g. the clearAt was overwritten with null
and afterwards the status modal showed "Invalid date" as "Clear at"

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v25.0.0beta1
Joas Schilling 2 years ago
parent
commit
52737c029c
No account linked to committer's email address

+ 2
- 2
apps/user_status/src/components/SetStatusModal.vue View File

@@ -55,14 +55,14 @@
<ClearAtSelect :clear-at="clearAt"
@select-clear-at="setClearAt" />
<div class="status-buttons">
<ButtonVue wide="true"
<ButtonVue :wide="true"
type="tertiary"
:text="$t('user_status', 'Clear status message')"
:disabled="isSavingStatus"
@click="clearStatus">
{{ $t('user_status', 'Clear status message') }}
</ButtonVue>
<ButtonVue wide="true"
<ButtonVue :wide="true"
type="primary"
:text="$t('user_status', 'Set status message')"
:disabled="isSavingStatus"

+ 15
- 4
apps/user_status/src/store/userStatus.js View File

@@ -130,12 +130,23 @@ const mutations = {
*/
loadStatusFromServer(state, { status, statusIsUserDefined, message, icon, clearAt, messageIsPredefined, messageId }) {
state.status = status
state.statusIsUserDefined = statusIsUserDefined
state.message = message
state.icon = icon
state.clearAt = clearAt
state.messageIsPredefined = messageIsPredefined
state.messageId = messageId

// Don't overwrite certain values if the refreshing comes in via short updates
// E.g. from talk participant list which only has the status, message and icon
if (typeof statusIsUserDefined !== 'undefined') {
state.statusIsUserDefined = statusIsUserDefined
}
if (typeof clearAt !== 'undefined') {
state.clearAt = clearAt
}
if (typeof messageIsPredefined !== 'undefined') {
state.messageIsPredefined = messageIsPredefined
}
if (typeof messageId !== 'undefined') {
state.messageId = messageId
}
},
}


+ 2
- 2
dist/user-status-modal-8299.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/user-status-modal-8299.js.map
File diff suppressed because it is too large
View File


+ 2
- 2
dist/user_status-menu.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/user_status-menu.js.map
File diff suppressed because it is too large
View File


Loading…
Cancel
Save