[FIX] Roles throwing error (#2110)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Djorkaeff Alexandre 2020-05-13 16:04:50 -03:00 committed by GitHub
parent 507723ab69
commit 70462f7c6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -316,7 +316,7 @@ const RocketChat = {
}
database.share = null;
reduxStore.dispatch(shareSetUser(null));
reduxStore.dispatch(shareSetUser({}));
},
updateJitsiTimeout(rid) {
@ -963,7 +963,7 @@ const RocketChat = {
const shareUser = reduxStore.getState().share.user;
const loginUser = reduxStore.getState().login.user;
// get user roles on the server from redux
const userRoles = (shareUser.roles || loginUser.roles) || [];
const userRoles = (shareUser?.roles || loginUser?.roles) || [];
// merge both roles
const mergedRoles = [...new Set([...roomRoles, ...userRoles])];