Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Don't overwrite certain values if the refreshing comes in via short u…
…pdates

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 <[email protected]>
  • Loading branch information
nickvergessen authored and skjnldsv committed May 31, 2022
commit e89a98b1eb12ed134e327e9ac4dbcc4a74cc12da
4 changes: 2 additions & 2 deletions apps/user_status/js/user-status-menu.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/user_status/js/user-status-menu.js.map

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions apps/user_status/src/store/userStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
}

Expand Down