mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-02-17 01:12:37 +01:00
Init Manage group button
This commit is contained in:
parent
01e78e8f38
commit
2ef94ffb02
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user