From 72a520fba4c021e0e6eca5caffe562f8683884e4 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Tue, 3 Sep 2024 11:32:22 -0300 Subject: [PATCH] fix: Retrieving Slack channels when Slack is disabled (#30074) --- .../src/features/alerts/components/NotificationMethod.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx index dff2b9e96..17a78697c 100644 --- a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx +++ b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx @@ -259,7 +259,12 @@ export const NotificationMethod: FunctionComponent = ({ }; useEffect(() => { - if (!slackOptions[0]?.options.length) { + const slackEnabled = options?.some( + option => + option === NotificationMethodOption.Slack || + option === NotificationMethodOption.SlackV2, + ); + if (slackEnabled && !slackOptions[0]?.options.length) { fetchSlackChannels({ types: ['public_channel', 'private_channel'] }) .then(({ json }) => { const { result } = json;