From ed62d06b5e188c5eabc2baf1a5c445a3cce8a2c1 Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Sat, 23 Oct 2021 15:41:16 +0530 Subject: [PATCH] SegmentedControl bug fixed Signed-off-by: Ajay Bura --- src/app/atoms/segmented-controls/SegmentedControls.jsx | 6 +++++- src/app/organisms/room/PeopleDrawer.jsx | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/atoms/segmented-controls/SegmentedControls.jsx b/src/app/atoms/segmented-controls/SegmentedControls.jsx index 2faaf2b..1d54dd0 100644 --- a/src/app/atoms/segmented-controls/SegmentedControls.jsx +++ b/src/app/atoms/segmented-controls/SegmentedControls.jsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import PropTypes from 'prop-types'; import './SegmentedControls.scss'; @@ -17,6 +17,10 @@ function SegmentedControls({ onSelect(segmentIndex); } + useEffect(() => { + setSelect(selected); + }, [selected]); + return (
{ diff --git a/src/app/organisms/room/PeopleDrawer.jsx b/src/app/organisms/room/PeopleDrawer.jsx index 098c450..050d8b6 100644 --- a/src/app/organisms/room/PeopleDrawer.jsx +++ b/src/app/organisms/room/PeopleDrawer.jsx @@ -65,7 +65,6 @@ function PeopleDrawer({ roomId }) { const [itemCount, setItemCount] = useState(PER_PAGE_MEMBER); const [membership, setMembership] = useState('join'); - window.setMemberShip = setMembership; const [memberList, setMemberList] = useState([]); const [searchedMembers, setSearchedMembers] = useState(null); const searchRef = useRef(null);