Skip to content

Commit 17432bf

Browse files
committed
Update EditGroup.jsx
1 parent b486515 commit 17432bf

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/views/identity/administration/EditGroup.jsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ const EditGroup = () => {
7676
const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery()
7777

7878
const [roleInfo, setroleInfo] = React.useState([])
79-
const [allowExternal, setAllowExternal] = useState(false)
8079
useEffect(() => {
8180
if (ownersIsSuccess && membersIsSuccess) {
8281
const ownerWithRole = owners.map((owner) => {
@@ -107,12 +106,6 @@ const EditGroup = () => {
107106
}
108107
}, [groupId, tenantDomain, dispatch])
109108

110-
useEffect(() => {
111-
if (SenderAuthIsSuccess) {
112-
setAllowExternal(!SenderAuth) // If SenderAuth is true, setAllowExternal to false, and vice versa
113-
}
114-
}, [SenderAuthIsSuccess, SenderAuth])
115-
116109
const onSubmit = (values) => {
117110
const shippedValues = {
118111
tenantID: tenantDomain,
@@ -170,7 +163,12 @@ const EditGroup = () => {
170163
{isSuccess && (
171164
<Form
172165
onSubmit={onSubmit}
173-
initialValues={{ allowExternal }}
166+
initialValues={{
167+
...(group[0].calculatedGroupType === 'Microsoft 365' ||
168+
group[0].calculatedGroupType === 'Distribution List'
169+
? { allowExternal: !SenderAuth.enabled }
170+
: {}),
171+
}}
174172
render={({ handleSubmit, submitting, values }) => {
175173
return (
176174
<CForm onSubmit={handleSubmit}>

0 commit comments

Comments
 (0)