Skip to content

Commit d2516f3

Browse files
authored
DEV: Option to always hide warning in the coposer (discourse#21618)
1 parent 4c4401b commit d2516f3

File tree

1 file changed

+8
-3
lines changed
  • app/assets/javascripts/discourse/app/services

1 file changed

+8
-3
lines changed

app/assets/javascripts/discourse/app/services/composer.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,13 @@ export default class ComposerController extends Controller {
397397
}
398398
}
399399

400-
@discourseComputed("model.creatingPrivateMessage", "model.targetRecipients")
401-
showWarning(creatingPrivateMessage, usernames) {
402-
if (!this.get("currentUser.staff")) {
400+
@discourseComputed(
401+
"model.creatingPrivateMessage",
402+
"model.targetRecipients",
403+
"model.warningsDisabled"
404+
)
405+
showWarning(creatingPrivateMessage, usernames, warningsDisabled) {
406+
if (!this.get("currentUser.staff") || warningsDisabled) {
403407
return false;
404408
}
405409

@@ -1335,6 +1339,7 @@ export default class ComposerController extends Controller {
13351339
composeState: Composer.OPEN,
13361340
isWarning: false,
13371341
hasTargetGroups: opts.hasGroups,
1342+
warningsDisabled: opts.warningsDisabled,
13381343
});
13391344

13401345
if (!this.model.targetRecipients) {

0 commit comments

Comments
 (0)