Listen focus and request members list

This commit is contained in:
mateusbrandaot 2022-11-30 22:29:34 -03:00
parent 92ae597b76
commit b2a65432a3
1 changed files with 9 additions and 0 deletions

View File

@ -115,6 +115,15 @@ const RoomMembersView = (): React.ReactElement => {
return () => subscription?.unsubscribe();
}, []);
useEffect(() => {
const unsubscribe = navigation.addListener('focus', () => {
const { allUsers } = state;
fetchMembers(allUsers);
});
return unsubscribe;
}, [navigation]);
useEffect(() => {
const fetchRoles = () => {
if (isGroupChat(state.room)) {