mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-02-20 18:52:35 +01:00
Close group settings on delete
This commit is contained in:
parent
70c19b6a60
commit
20325a2e88
@ -150,7 +150,7 @@ export const GroupCreatorView: FC<GroupCreatorViewProps> = props =>
|
||||
</Flex>
|
||||
<Column overflow="hidden">
|
||||
{ (currentTab === 1) &&
|
||||
<GroupTabIdentityView groupData={ groupData } setGroupData={ setGroupData } setCloseAction={ setCloseAction } isCreator={ true } availableRooms={ availableRooms } /> }
|
||||
<GroupTabIdentityView groupData={ groupData } setGroupData={ setGroupData } setCloseAction={ setCloseAction } close={ null } isCreator={ true } availableRooms={ availableRooms } /> }
|
||||
{ (currentTab === 2) &&
|
||||
<GroupTabBadgeView groupData={ groupData } setGroupData={ setGroupData } setCloseAction={ setCloseAction } /> }
|
||||
{ (currentTab === 3) &&
|
||||
|
@ -110,7 +110,7 @@ export const GroupManagerView: FC<{}> = props =>
|
||||
</Flex>
|
||||
<Column grow overflow="hidden">
|
||||
{ currentTab === 1 &&
|
||||
<GroupTabIdentityView groupData={ groupData } setGroupData={ setGroupData } setCloseAction={ setCloseAction } /> }
|
||||
<GroupTabIdentityView groupData={ groupData } setGroupData={ setGroupData } setCloseAction={ setCloseAction } close={ close } /> }
|
||||
{ currentTab === 2 &&
|
||||
<GroupTabBadgeView groupData={ groupData } setGroupData={ setGroupData } setCloseAction={ setCloseAction } skipDefault={ true } /> }
|
||||
{ currentTab === 3 &&
|
||||
|
@ -10,13 +10,14 @@ interface GroupTabIdentityViewProps
|
||||
groupData: IGroupData;
|
||||
setGroupData: Dispatch<SetStateAction<IGroupData>>;
|
||||
setCloseAction: Dispatch<SetStateAction<{ action: () => boolean }>>;
|
||||
close: () => void;
|
||||
isCreator?: boolean;
|
||||
availableRooms?: { id: number, name: string }[];
|
||||
}
|
||||
|
||||
export const GroupTabIdentityView: FC<GroupTabIdentityViewProps> = props =>
|
||||
{
|
||||
const { groupData = null, setGroupData = null, setCloseAction = null, isCreator = false, availableRooms = [] } = props;
|
||||
const { groupData = null, setGroupData = null, setCloseAction = null, close = null, isCreator = false, availableRooms = [] } = props;
|
||||
const [ groupName, setGroupName ] = useState<string>('');
|
||||
const [ groupDescription, setGroupDescription ] = useState<string>('');
|
||||
const [ groupHomeroomId, setGroupHomeroomId ] = useState<number>(-1);
|
||||
@ -28,6 +29,8 @@ export const GroupTabIdentityView: FC<GroupTabIdentityViewProps> = props =>
|
||||
NotificationUtilities.confirm(LocalizeText('group.deleteconfirm.desc'), () =>
|
||||
{
|
||||
SendMessageComposer(new GroupDeleteComposer(groupData.groupId));
|
||||
|
||||
if(close) close();
|
||||
}, null, null, null, LocalizeText('group.deleteconfirm.title'));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user