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
1 changed files with 8 additions and 3 deletions

View File

@ -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) {