fix: update the user's email when changed (#5485)

This commit is contained in:
Reinaldo Neto 2024-01-19 12:04:38 -03:00 committed by GitHub
parent 2b2c941624
commit 9c8aaa2c0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -296,6 +296,9 @@ export default function subscribeRooms() {
const [, ev] = ddpMessage.fields.eventName.split('/');
if (/userData/.test(ev)) {
const [{ diff, unset }] = ddpMessage.fields.args;
if (diff.emails?.length > 0) {
store.dispatch(setUser({ emails: diff.emails }));
}
if (diff?.statusLivechat) {
store.dispatch(setUser({ statusLivechat: diff.statusLivechat }));
}