Skip to content

Commit 0137b07

Browse files
committed
fix(announcement): allow @ALL as mattermost mention
1 parent 7ff0bef commit 0137b07

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

ui/src/components/announcements/AnnouncementForm.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ interface Props {
2727

2828
// Returns true if the text contains any of the mentions
2929
const includesMention = (text: string, mentions: string[]): boolean => {
30-
for (const m of mentions) {
31-
if (text.includes(m)) return true
32-
}
33-
34-
return false
30+
return mentions.some(m => text.includes(m))
3531
}
3632

3733
export function AnnouncementForm({ announcement, defaultEvents, onSubmit }: Props) {
@@ -70,7 +66,7 @@ export function AnnouncementForm({ announcement, defaultEvents, onSubmit }: Prop
7066
let warningText = ""
7167

7268
// Check mattermost mention
73-
let mentions = ["@channel"]
69+
let mentions = ["@channel", "@all"]
7470
if (!includesMention(form.state.values.content, mentions)) {
7571
warningText += "No mattermost mention.\n"
7672
}

0 commit comments

Comments
 (0)