fix: SonarCloud warnings

This commit is contained in:
Joao Victor 2022-08-31 10:33:55 -03:00
parent 85a9138ac6
commit 916a14e1f9
2 changed files with 3 additions and 4 deletions

View File

@ -12,8 +12,8 @@ const ROLE_MODERATOR = Meteor.settings.public.user.role_moderator;
const CursorContainer = (props) => { const CursorContainer = (props) => {
const { cursorX, cursorY, presenter, uid, isViewersCursorLocked } = props; const { cursorX, cursorY, presenter, uid, isViewersCursorLocked } = props;
const usingUsersContext = useContext(UsersContext);
if (cursorX > 0 && cursorY > 0) { if (cursorX > 0 && cursorY > 0) {
const usingUsersContext = useContext(UsersContext);
const { users } = usingUsersContext; const { users } = usingUsersContext;
const role = users[Auth.meetingID][Auth.userID].role; const role = users[Auth.meetingID][Auth.userID].role;
const userId = users[Auth.meetingID][Auth.userID].userId; const userId = users[Auth.meetingID][Auth.userID].userId;

View File

@ -9,13 +9,12 @@ const SidebarContentContainer = () => {
const sidebarContentOutput = layoutSelectOutput((i) => i.sidebarContent); const sidebarContentOutput = layoutSelectOutput((i) => i.sidebarContent);
const layoutContextDispatch = layoutDispatch(); const layoutContextDispatch = layoutDispatch();
const { sidebarContentPanel } = sidebarContentInput; const { sidebarContentPanel } = sidebarContentInput;
if (sidebarContentOutput.display === false) return null;
const usingUsersContext = useContext(UsersContext); const usingUsersContext = useContext(UsersContext);
const { users } = usingUsersContext; const { users } = usingUsersContext;
const amIPresenter = users[Auth.meetingID][Auth.userID].presenter; const amIPresenter = users[Auth.meetingID][Auth.userID].presenter;
if (sidebarContentOutput.display === false) return null;
return ( return (
<SidebarContent <SidebarContent
{...sidebarContentOutput} {...sidebarContentOutput}