Close group settings on delete

This commit is contained in:
Bill 2022-03-27 22:41:47 -04:00
parent 70c19b6a60
commit 20325a2e88
3 changed files with 6 additions and 3 deletions

View File

@ -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) &&

View File

@ -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 &&

View File

@ -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'));
}