Skip to content

Commit

Permalink
fixed: lock_private_chat for individual user wasn't working.
Browse files Browse the repository at this point in the history
  • Loading branch information
jibon57 committed Jun 15, 2023
1 parent df5a084 commit 27009dc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/participants/participant/icons/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@ const defaultLockSettingsSelector = createSelector(
(default_lock_settings) => default_lock_settings,
);

const currentUserLockSettingsSelector = createSelector(
(state: RootState) => state.session.currentUser?.metadata?.lock_settings,
(lock_settings) => lock_settings,
);

const MenuIcon = ({
userId,
name,
isAdmin,
openRemoveParticipantAlert,
}: IMenuIconProps) => {
const defaultLockSettings = useAppSelector(defaultLockSettingsSelector);
const currentUserLockSettings = useAppSelector(
currentUserLockSettingsSelector,
);
const currentUser = store.getState().session.currentUser;

const renderMenuItems = () => {
Expand All @@ -54,6 +62,7 @@ const MenuIcon = ({
// if lock then user won't be able to send private messages to each other
if (
!currentUser?.metadata?.is_admin &&
!currentUserLockSettings?.lock_private_chat &&
!defaultLockSettings?.lock_chat &&
!defaultLockSettings?.lock_private_chat
) {
Expand Down

0 comments on commit 27009dc

Please sign in to comment.