zahmis 5 лет назад
Родитель
Сommit
a031a2896a

+ 2 - 0
src/client/js/components/Admin/SlackIntegration/CustomBotWithoutProxySecretTokenSection.jsx

@@ -21,6 +21,7 @@ const CustomBotWithoutProxySecretTokenSection = (props) => {
   const updateSecretTokenHandler = () => {
   const updateSecretTokenHandler = () => {
     if (props.updateSecretTokenHandler != null) {
     if (props.updateSecretTokenHandler != null) {
       props.updateSecretTokenHandler();
       props.updateSecretTokenHandler();
+      props.fetchSlackWorkSpaceName();
     }
     }
   };
   };
 
 
@@ -98,6 +99,7 @@ CustomBotWithoutProxySecretTokenSection.propTypes = {
   slackSigningSecretEnv: PropTypes.string,
   slackSigningSecretEnv: PropTypes.string,
   slackBotToken: PropTypes.string,
   slackBotToken: PropTypes.string,
   slackBotTokenEnv: PropTypes.string,
   slackBotTokenEnv: PropTypes.string,
+  fetchSlackWorkSpaceName: PropTypes.func,
 };
 };
 
 
 export default CustomBotWithoutProxySecretTokenSection;
 export default CustomBotWithoutProxySecretTokenSection;

+ 3 - 12
src/client/js/components/Admin/SlackIntegration/CustomBotWithoutProxySettings.jsx

@@ -16,15 +16,6 @@ const CustomBotWithoutProxySettings = (props) => {
 
 
   const [siteName, setSiteName] = useState('');
   const [siteName, setSiteName] = useState('');
 
 
-  // const fetchSlackWorkSpaceName = useCallback(async() => {
-  //   try {
-  //     const res = await appContainer.apiv3.get('/slack-integration/custom-bot-without-proxy/slack-workspace-name');
-  //     setSlackWSNameInWithoutProxy(res.data.slackWorkSpaceName);
-  //   }
-  //   catch (err) {
-  //     toastError(err);
-  //   }
-  // }, [appContainer.apiv3]);
 
 
   const fetchSiteName = useCallback(() => {
   const fetchSiteName = useCallback(() => {
     const siteName = appContainer.config.crowi.title;
     const siteName = appContainer.config.crowi.title;
@@ -33,9 +24,7 @@ const CustomBotWithoutProxySettings = (props) => {
 
 
   useEffect(() => {
   useEffect(() => {
     fetchSiteName();
     fetchSiteName();
-    // if (props.isSetupSlackBot) {
-    //   fetchSlackWorkSpaceName();
-    // }
+
   }, [appContainer, fetchSiteName]);
   }, [appContainer, fetchSiteName]);
 
 
   return (
   return (
@@ -100,6 +89,8 @@ CustomBotWithoutProxySettings.propTypes = {
   isConnectedToSlack: PropTypes.bool,
   isConnectedToSlack: PropTypes.bool,
   // isSetupSlackBot: PropTypes.bool,
   // isSetupSlackBot: PropTypes.bool,
   slackWSNameInWithoutProxy: PropTypes.string,
   slackWSNameInWithoutProxy: PropTypes.string,
+  // setSlackWSNameInWithoutProxy: PropTypes.func,
+  // fetchSlackWorkSpaceName: PropTypes.func,
 };
 };
 
 
 export default CustomBotWithoutProxySettingsWrapper;
 export default CustomBotWithoutProxySettingsWrapper;