@@ -76,7 +76,6 @@ const EditGroup = () => {
76
76
const [ genericPostRequest , postResults ] = useLazyGenericPostRequestQuery ( )
77
77
78
78
const [ roleInfo , setroleInfo ] = React . useState ( [ ] )
79
- const [ allowExternal , setAllowExternal ] = useState ( false )
80
79
useEffect ( ( ) => {
81
80
if ( ownersIsSuccess && membersIsSuccess ) {
82
81
const ownerWithRole = owners . map ( ( owner ) => {
@@ -107,12 +106,6 @@ const EditGroup = () => {
107
106
}
108
107
} , [ groupId , tenantDomain , dispatch ] )
109
108
110
- useEffect ( ( ) => {
111
- if ( SenderAuthIsSuccess ) {
112
- setAllowExternal ( ! SenderAuth ) // If SenderAuth is true, setAllowExternal to false, and vice versa
113
- }
114
- } , [ SenderAuthIsSuccess , SenderAuth ] )
115
-
116
109
const onSubmit = ( values ) => {
117
110
const shippedValues = {
118
111
tenantID : tenantDomain ,
@@ -170,7 +163,12 @@ const EditGroup = () => {
170
163
{ isSuccess && (
171
164
< Form
172
165
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
+ } }
174
172
render = { ( { handleSubmit, submitting, values } ) => {
175
173
return (
176
174
< CForm onSubmit = { handleSubmit } >
0 commit comments