|
@@ -33,10 +33,11 @@ const SlackIntegration = (props) => {
|
|
|
if (!isConnectedToSlack) {
|
|
if (!isConnectedToSlack) {
|
|
|
return setSlackWSNameInWithoutProxy(null);
|
|
return setSlackWSNameInWithoutProxy(null);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
const res = await appContainer.apiv3.get('/slack-integration/custom-bot-without-proxy/slack-workspace-name');
|
|
const res = await appContainer.apiv3.get('/slack-integration/custom-bot-without-proxy/slack-workspace-name');
|
|
|
setSlackWSNameInWithoutProxy(res.data.slackWorkSpaceName);
|
|
setSlackWSNameInWithoutProxy(res.data.slackWorkSpaceName);
|
|
|
- setIsSlackScopeSet(true);
|
|
|
|
|
|
|
+ // setIsSlackScopeSet(true);
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
if (err[0].message === 'missing_scope') {
|
|
if (err[0].message === 'missing_scope') {
|
|
@@ -66,6 +67,7 @@ const SlackIntegration = (props) => {
|
|
|
setSlackBotTokenEnv(slackBotTokenEnvVars);
|
|
setSlackBotTokenEnv(slackBotTokenEnvVars);
|
|
|
setIsConnectedToSlack(isConnectedToSlack);
|
|
setIsConnectedToSlack(isConnectedToSlack);
|
|
|
setIsSetupSlackBot(isSetupSlackBot);
|
|
setIsSetupSlackBot(isSetupSlackBot);
|
|
|
|
|
+ setIsSlackScopeSet(isSlackScopeSet);
|
|
|
|
|
|
|
|
fetchSlackWorkSpaceNameInWithoutProxy();
|
|
fetchSlackWorkSpaceNameInWithoutProxy();
|
|
|
|
|
|
|
@@ -81,7 +83,7 @@ const SlackIntegration = (props) => {
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
toastError(err);
|
|
toastError(err);
|
|
|
}
|
|
}
|
|
|
- }, [appContainer.apiv3, fetchSlackWorkSpaceNameInWithoutProxy]);
|
|
|
|
|
|
|
+ }, [appContainer.apiv3, fetchSlackWorkSpaceNameInWithoutProxy, isSlackScopeSet]);
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -147,6 +149,7 @@ const SlackIntegration = (props) => {
|
|
|
slackSigningSecret={slackSigningSecret}
|
|
slackSigningSecret={slackSigningSecret}
|
|
|
slackWSNameInWithoutProxy={slackWSNameInWithoutProxy}
|
|
slackWSNameInWithoutProxy={slackWSNameInWithoutProxy}
|
|
|
onSetIsSetupSlackBot={setIsSetupSlackBot}
|
|
onSetIsSetupSlackBot={setIsSetupSlackBot}
|
|
|
|
|
+ // onSetIsSlackScopeSet={setIsSlackScopeSet}
|
|
|
onSetSlackSigningSecret={setSlackSigningSecret}
|
|
onSetSlackSigningSecret={setSlackSigningSecret}
|
|
|
onSetSlackBotToken={setSlackBotToken}
|
|
onSetSlackBotToken={setSlackBotToken}
|
|
|
onSetIsSendTestMessage={setIsSendTestMessage}
|
|
onSetIsSendTestMessage={setIsSendTestMessage}
|