fix: Retrieving Slack channels when Slack is disabled (#30074)

This commit is contained in:
Michael S. Molina 2024-09-03 11:32:22 -03:00 committed by GitHub
parent 9596e458c6
commit 72a520fba4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -259,7 +259,12 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
}; };
useEffect(() => { 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'] }) fetchSlackChannels({ types: ['public_channel', 'private_channel'] })
.then(({ json }) => { .then(({ json }) => {
const { result } = json; const { result } = json;