Skip to content

Commit 05df9ff

Browse files
committed
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>
1 parent 3b4f077 commit 05df9ff

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

apps/user_status/src/store/userStatus.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,23 @@ const mutations = {
130130
*/
131131
loadStatusFromServer(state, { status, statusIsUserDefined, message, icon, clearAt, messageIsPredefined, messageId }) {
132132
state.status = status
133-
state.statusIsUserDefined = statusIsUserDefined
134133
state.message = message
135134
state.icon = icon
136-
state.clearAt = clearAt
137-
state.messageIsPredefined = messageIsPredefined
138-
state.messageId = messageId
135+
136+
// Don't overwrite certain values if the refreshing comes in via short updates
137+
// E.g. from talk participant list which only has the status, message and icon
138+
if (typeof statusIsUserDefined !== 'undefined') {
139+
state.statusIsUserDefined = statusIsUserDefined
140+
}
141+
if (typeof clearAt !== 'undefined') {
142+
state.clearAt = clearAt
143+
}
144+
if (typeof messageIsPredefined !== 'undefined') {
145+
state.messageIsPredefined = messageIsPredefined
146+
}
147+
if (typeof messageId !== 'undefined') {
148+
state.messageId = messageId
149+
}
139150
},
140151
}
141152

0 commit comments

Comments
 (0)