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>
pull/32618/head
Joas Schilling 2 years ago
parent 5f2e7e9710
commit 52737c029c
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA

@ -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"

@ -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
}
},
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save