Просмотр исходного кода

delete isSetupSlackBot and add onSetIsSlackScopeSet

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

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

@@ -23,7 +23,7 @@ const CustomBotWithoutProxyIntegrationCard = (props) => {
       </div>
 
       <div className="text-center w-25">
-        {props.isSetupSlackBot && props.isSlackScopeSet && (
+        {props.isSlackScopeSet && (
         <div className="mt-5">
           <p className="text-success small">
             <i className="fa fa-check mr-1" />
@@ -32,7 +32,7 @@ const CustomBotWithoutProxyIntegrationCard = (props) => {
           <hr className="align-self-center admin-border-success border-success"></hr>
         </div>
           )}
-        {(!props.isSetupSlackBot || !props.isSlackScopeSet) && (
+        {!props.isSlackScopeSet && (
         <div className="mt-4">
           <small
             className="text-secondary m-0"

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

@@ -23,6 +23,12 @@ const CustomBotWithoutProxySettings = (props) => {
     }
   };
 
+  const onSetIsSlackScopeSet = () => {
+    if (props.onSetIsSlackScopeSet != null) {
+      props.onSetIsSlackScopeSet();
+    }
+  };
+
   const deleteSlackCredentialsHandler = async() => {
     try {
       await appContainer.apiv3.put('/slack-integration/custom-bot-without-proxy', {
@@ -31,6 +37,7 @@ const CustomBotWithoutProxySettings = (props) => {
         currentBotType: '',
       });
       onSetIsSetupSlackBot(false);
+      onSetIsSlackScopeSet(false);
       toastSuccess('success');
     }
     catch (err) {
@@ -95,6 +102,7 @@ CustomBotWithoutProxySettings.propTypes = {
   isSetupSlackBot: PropTypes.bool,
   slackWSNameInWithoutProxy: PropTypes.string,
   onSetIsSetupSlackBot: PropTypes.func,
+  onSetIsSlackScopeSet: PropTypes.func,
 };
 
 export default CustomBotWithoutProxySettingsWrapper;