Skip to content

Commit e89a98b

Browse files
nickvergessenskjnldsv
authored andcommitted
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 ee0e9b7 commit e89a98b

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

apps/user_status/js/user-status-menu.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/user_status/js/user-status-menu.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)