fix: Retrieving Slack channels when Slack is disabled (#30074)
This commit is contained in:
parent
9596e458c6
commit
72a520fba4
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue