Skip to content

A platform for community discussion. Free, open, simple.

DEV: Option to always hide warning in the coposer (#21618)

Roman Rizzid2516f39c349
diff --git a/app/assets/javascripts/discourse/app/services/composer.js b/app/assets/javascripts/discourse/app/services/composer.js
index ecca73bb6da..66f256fe882 100644
--- a/app/assets/javascripts/discourse/app/services/composer.js
+++ b/app/assets/javascripts/discourse/app/services/composer.js
@@ -397,9 +397,13 @@ export default class ComposerController extends Controller {
}
}
- @discourseComputed("model.creatingPrivateMessage", "model.targetRecipients")
- showWarning(creatingPrivateMessage, usernames) {
- if (!this.get("currentUser.staff")) {
+ @discourseComputed(
+ "model.creatingPrivateMessage",
+ "model.targetRecipients",
+ "model.warningsDisabled"
+ )
+ showWarning(creatingPrivateMessage, usernames, warningsDisabled) {
+ if (!this.get("currentUser.staff") || warningsDisabled) {
return false;
}
@@ -1335,6 +1339,7 @@ export default class ComposerController extends Controller {
composeState: Composer.OPEN,
isWarning: false,
hasTargetGroups: opts.hasGroups,
+ warningsDisabled: opts.warningsDisabled,
});
if (!this.model.targetRecipients) {