Skip to content

Commit

Permalink
fix: Retrieving Slack channels when Slack is disabled (#30074)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina committed Sep 3, 2024
1 parent 9596e45 commit 72a520f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,12 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
};

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;
Expand Down

0 comments on commit 72a520f

Please sign in to comment.