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

This commit is contained in:
Roman Rizzi 2023-05-17 15:59:43 -03:00 committed by GitHub
parent 4c4401b726
commit d2516f39c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -397,9 +397,13 @@ export default class ComposerController extends Controller {
} }
} }
@discourseComputed("model.creatingPrivateMessage", "model.targetRecipients") @discourseComputed(
showWarning(creatingPrivateMessage, usernames) { "model.creatingPrivateMessage",
if (!this.get("currentUser.staff")) { "model.targetRecipients",
"model.warningsDisabled"
)
showWarning(creatingPrivateMessage, usernames, warningsDisabled) {
if (!this.get("currentUser.staff") || warningsDisabled) {
return false; return false;
} }
@ -1335,6 +1339,7 @@ export default class ComposerController extends Controller {
composeState: Composer.OPEN, composeState: Composer.OPEN,
isWarning: false, isWarning: false,
hasTargetGroups: opts.hasGroups, hasTargetGroups: opts.hasGroups,
warningsDisabled: opts.warningsDisabled,
}); });
if (!this.model.targetRecipients) { if (!this.model.targetRecipients) {