Przeglądaj źródła

delete credential if change bot type

zahmis 5 lat temu
rodzic
commit
7db7186dbd

+ 2 - 1
src/client/js/components/Admin/SlackIntegration/CustomBotWithoutProxySettingsAccordion.jsx

@@ -46,10 +46,11 @@ const CustomBotWithoutProxySettingsAccordion = ({
         slackBotToken,
         currentBotType,
       });
-      setIsRegisterSlackCredentials(false);
+      setIsRegisterSlackCredentials(true);
       toastSuccess(t('toaster.update_successed', { target: t('admin:slack_integration.custom_bot_without_proxy_settings') }));
     }
     catch (err) {
+      setIsRegisterSlackCredentials(false);
       toastError(err);
     }
   };

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

@@ -67,6 +67,9 @@ const SlackIntegration = (props) => {
       setCurrentBotType(clickedBotType);
       return;
     }
+    setIsRegisterSlackCredentials(false);
+    setSlackSigningSecret('');
+    setSlackBotToken('');
     setSelectedBotType(clickedBotType);
   };