Init Manage group button

This commit is contained in:
MyNameIsBatman 2021-08-31 20:00:55 -03:00
parent 01e78e8f38
commit 2ef94ffb02

View File

@ -67,6 +67,8 @@ export const GroupRoomInformationView: FC<{}> = props =>
SendMessageHook(new GroupRemoveMemberComposer(groupInformation.id, GetSessionDataManager().userId));
SendMessageHook(new GroupInformationComposer(groupInformation.id, false));
}, [ groupInformation ]);
const manageGroup = useCallback(() => {}, []);
const getButtonText = useCallback(() =>
{
@ -88,12 +90,14 @@ export const GroupRoomInformationView: FC<{}> = props =>
const handleButtonClick = useCallback(() =>
{
if(isRealOwner()) return manageGroup();
if(groupInformation.type === GroupType.PRIVATE && groupInformation.membershipType === GroupMembershipType.NOT_MEMBER) return;
if(groupInformation.membershipType === GroupMembershipType.MEMBER) return tryLeaveGroup();
return tryJoinGroup();
}, [ groupInformation, tryLeaveGroup, tryJoinGroup ]);
}, [ groupInformation, tryLeaveGroup, tryJoinGroup, isRealOwner, manageGroup ]);
if(!groupInformation) return null;