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

+ 4 - 3
src/client/js/components/Admin/SlackIntegration/CustomBotWithoutProxySettingsAccordion.jsx

@@ -39,12 +39,13 @@ const CustomBotWithoutProxySettingsAccordion = ({
         currentBotType,
         currentBotType,
       });
       });
 
 
-      if (isConnectedToSlack) {
+      if (isConnectedToSlack === false) {
         return (
         return (
-          onSetIsRegisterSlackCredentials(true),
-          onSetIsSendTestMessage(true)
+          onSetIsRegisterSlackCredentials(false),
+          onSetIsSendTestMessage(false)
         );
         );
       }
       }
+      onSetIsRegisterSlackCredentials(true);
 
 
       toastSuccess(t('toaster.update_successed', { target: t('admin:slack_integration.custom_bot_without_proxy_settings') }));
       toastSuccess(t('toaster.update_successed', { target: t('admin:slack_integration.custom_bot_without_proxy_settings') }));
     }
     }

+ 4 - 6
src/client/js/components/Admin/SlackIntegration/SlackIntegration.jsx

@@ -37,8 +37,6 @@ const SlackIntegration = (props) => {
         isSetupSlackBot, isConnectedToSlack,
         isSetupSlackBot, isConnectedToSlack,
       } = customBotWithoutProxySettings;
       } = customBotWithoutProxySettings;
 
 
-      console.log(isConnectedToSlack);
-
       setCurrentBotType(currentBotType);
       setCurrentBotType(currentBotType);
       setSlackSigningSecret(slackSigningSecret);
       setSlackSigningSecret(slackSigningSecret);
       setSlackBotToken(slackBotToken);
       setSlackBotToken(slackBotToken);
@@ -47,11 +45,11 @@ const SlackIntegration = (props) => {
       setIsConnectedToSlack(isConnectedToSlack);
       setIsConnectedToSlack(isConnectedToSlack);
       setIsSetupSlackBot(isSetupSlackBot);
       setIsSetupSlackBot(isSetupSlackBot);
 
 
-      setIsRegisterSlackCredentials(false);
-
-      if (isConnectedToSlack) {
-        return setIsRegisterSlackCredentials(true);
+      if (isConnectedToSlack === false) {
+        return setIsRegisterSlackCredentials(false);
       }
       }
+      setIsRegisterSlackCredentials(true);
+
     }
     }
     catch (err) {
     catch (err) {
       toastError(err);
       toastError(err);