@@ -40,17 +40,19 @@ export default function BuddyBossIntegLayout({
4040  isInfo, 
4141  edit
4242} )  { 
43+   const  mainAction  =  Number ( buddyBossConf ?. mainAction ) 
44+ 
4345  useEffect ( ( )  =>  { 
44-     if  ( toFetchGroups . includes ( Number ( buddyBossConf ?. mainAction ) ) )  { 
46+     if  ( toFetchGroups . includes ( mainAction ) )  { 
4547      getAllBuddyBossGroup ( buddyBossConf ,  setBuddyBossConf ,  setIsLoading ,  setSnackbar ) 
4648    } 
47-     if  ( toFetchUsers . includes ( Number ( buddyBossConf ?. mainAction ) ) )  { 
49+     if  ( toFetchUsers . includes ( mainAction ) )  { 
4850      getAllUser ( buddyBossConf ,  setBuddyBossConf ,  setIsLoading ,  setSnackbar ) 
4951    } 
50-     if  ( toFetchForum . includes ( Number ( buddyBossConf ?. mainAction ) ) )  { 
52+     if  ( toFetchForum . includes ( mainAction ) )  { 
5153      getAllForum ( buddyBossConf ,  setBuddyBossConf ,  setIsLoading ,  setSnackbar ) 
5254    } 
53-   } ,  [ buddyBossConf . mainAction ] ) 
55+   } ,  [ mainAction ] ) 
5456
5557  const  changeHandler  =  ( val ,  name )  =>  { 
5658    const  newConf  =  {  ...buddyBossConf  } 
@@ -67,7 +69,7 @@ export default function BuddyBossIntegLayout({
6769  const  getFields  =  ( e )  =>  { 
6870    let  buddyBossFields 
6971
70-     switch  ( Number ( buddyBossConf ?. mainAction ) )  { 
72+     switch  ( mainAction )  { 
7173      case  CREATE_GROUP_PRO :
7274        buddyBossFields  =  buddyBossConf ?. createGroupFields  ||  [ ] 
7375        break 
@@ -125,7 +127,7 @@ export default function BuddyBossIntegLayout({
125127      </ select > 
126128      < br  /> 
127129      < br  /> 
128-       { showGroupActions . includes ( Number ( buddyBossConf ?. mainAction ) )  &&  ( 
130+       { showGroupActions . includes ( mainAction )  &&  ( 
129131        < > 
130132          < br  /> 
131133          < div  className = "flx mt-4" > 
@@ -154,7 +156,7 @@ export default function BuddyBossIntegLayout({
154156        </ > 
155157      ) } 
156158
157-       { showUserActions . includes ( Number ( buddyBossConf ?. mainAction ) )  &&  ( 
159+       { showUserActions . includes ( mainAction )  &&  ( 
158160        < > 
159161          < br  /> 
160162          < div  className = "flx mt-4" > 
@@ -177,7 +179,7 @@ export default function BuddyBossIntegLayout({
177179                } ) ) 
178180              } 
179181              onChange = { ( val )  =>  changeHandler ( val ,  'friendId' ) } 
180-               singleSelect = { Number ( buddyBossConf ?. mainAction )  !==  STOP_FOLLOWING_USER_PRO } 
182+               singleSelect = { mainAction  !==  STOP_FOLLOWING_USER_PRO } 
181183            /> 
182184            < button 
183185              onClick = { ( )  =>  getAllUser ( buddyBossConf ,  setBuddyBossConf ,  setIsLoading ,  setSnackbar ) } 
@@ -191,7 +193,7 @@ export default function BuddyBossIntegLayout({
191193        </ > 
192194      ) } 
193195
194-       { Number ( buddyBossConf ?. mainAction )  ===  SEND_PRIVATE_MSG_USER_PRO  &&  ( 
196+       { mainAction  ===  SEND_PRIVATE_MSG_USER_PRO  &&  ( 
195197        < > 
196198          < div  className = "flx mt-4" > 
197199            < b  className = "wdt-200 d-in-b" > { __ ( 'Recipient User' ,  'bit-integrations' ) } </ b > 
@@ -232,7 +234,7 @@ export default function BuddyBossIntegLayout({
232234        </ > 
233235      ) } 
234236
235-       { showForumActions . includes ( Number ( buddyBossConf ?. mainAction ) )  &&  ( 
237+       { showForumActions . includes ( mainAction )  &&  ( 
236238        < > 
237239          < br  /> 
238240          < div  className = "flx mt-4" > 
@@ -248,7 +250,7 @@ export default function BuddyBossIntegLayout({
248250                } ) ) 
249251              } 
250252              onChange = { ( val )  =>  changeHandler ( val ,  'forumId' ) } 
251-               singleSelect = { Number ( buddyBossConf ?. mainAction )  !==  SUBSCRIBE_USER_FORUM_PRO } 
253+               singleSelect = { mainAction  !==  SUBSCRIBE_USER_FORUM_PRO } 
252254            /> 
253255            < button 
254256              onClick = { ( )  =>  getAllForum ( buddyBossConf ,  setBuddyBossConf ,  setIsLoading ,  setSnackbar ) } 
@@ -261,38 +263,37 @@ export default function BuddyBossIntegLayout({
261263          </ div > 
262264        </ > 
263265      ) } 
264-       { buddyBossConf ?. forumId  !==  undefined  && 
265-         Number ( buddyBossConf ?. mainAction )  ===  POST_REPLY_TOPIC_FORUM_PRO  &&  ( 
266-           < > 
267-             < br  /> 
268-             < div  className = "flx mt-4" > 
269-               < b  className = "wdt-200 d-in-b" > { __ ( 'Select Topic:' ,  'bit-integrations' ) } </ b > 
270-               < MultiSelect 
271-                 className = "w-5" 
272-                 defaultValue = { buddyBossConf ?. topicId } 
273-                 options = { 
274-                   buddyBossConf ?. default ?. allTopic  && 
275-                   buddyBossConf . default . allTopic . map ( ( item )  =>  ( { 
276-                     label : item . topic_title , 
277-                     value : item . topic_id . toString ( ) 
278-                   } ) ) 
279-                 } 
280-                 onChange = { ( val )  =>  changeHandler ( val ,  'topicId' ) } 
281-                 singleSelect 
282-               /> 
283-               < button 
284-                 onClick = { ( )  =>  getAllTopic ( buddyBossConf ,  setBuddyBossConf ,  setIsLoading ,  setSnackbar ) } 
285-                 className = "icn-btn sh-sm ml-2 mr-2 tooltip" 
286-                 style = { {  '--tooltip-txt' : `'${ __ ( 'Fetch All Topic' ,  'bit-integrations' ) }   } } 
287-                 type = "button" 
288-                 disabled = { isLoading } > 
289-                 ↻
290-               </ button > 
291-             </ div > 
292-           </ > 
293-         ) } 
266+       { buddyBossConf ?. forumId  !==  undefined  &&  mainAction  ===  POST_REPLY_TOPIC_FORUM_PRO  &&  ( 
267+         < > 
268+           < br  /> 
269+           < div  className = "flx mt-4" > 
270+             < b  className = "wdt-200 d-in-b" > { __ ( 'Select Topic:' ,  'bit-integrations' ) } </ b > 
271+             < MultiSelect 
272+               className = "w-5" 
273+               defaultValue = { buddyBossConf ?. topicId } 
274+               options = { 
275+                 buddyBossConf ?. default ?. allTopic  && 
276+                 buddyBossConf . default . allTopic . map ( ( item )  =>  ( { 
277+                   label : item . topic_title , 
278+                   value : item . topic_id . toString ( ) 
279+                 } ) ) 
280+               } 
281+               onChange = { ( val )  =>  changeHandler ( val ,  'topicId' ) } 
282+               singleSelect 
283+             /> 
284+             < button 
285+               onClick = { ( )  =>  getAllTopic ( buddyBossConf ,  setBuddyBossConf ,  setIsLoading ,  setSnackbar ) } 
286+               className = "icn-btn sh-sm ml-2 mr-2 tooltip" 
287+               style = { {  '--tooltip-txt' : `'${ __ ( 'Fetch All Topic' ,  'bit-integrations' ) }   } } 
288+               type = "button" 
289+               disabled = { isLoading } > 
290+               ↻
291+             </ button > 
292+           </ div > 
293+         </ > 
294+       ) } 
294295
295-       { Number ( buddyBossConf ?. mainAction )  ===  SET_USER_STATUS_PRO  &&  ( 
296+       { mainAction  ===  SET_USER_STATUS_PRO  &&  ( 
296297        < > 
297298          < br  /> 
298299          < div  className = "flx mt-4" > 
@@ -326,7 +327,7 @@ export default function BuddyBossIntegLayout({
326327      ) } 
327328
328329      < > 
329-         { showFieldMapping . includes ( Number ( buddyBossConf ?. mainAction ) )  &&  ( 
330+         { showFieldMapping . includes ( mainAction )  &&  ( 
330331          < > 
331332            < div  className = "mt-4" > 
332333              < b  className = "wdt-100" > { __ ( 'Map Fields' ,  'bit-integrations' ) } </ b > 
0 commit comments