FIX: Hide suggestion to send PMs when PMs are disabled for user (#26157)

This commit is contained in:
Jan Cernik 2024-03-13 16:29:22 -03:00 committed by GitHub
parent 551c6022dc
commit 2d074ad4a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -107,12 +107,14 @@ export default (inboxType, path, filter) => {
emptyState() { emptyState() {
const title = I18n.t("user.no_messages_title"); const title = I18n.t("user.no_messages_title");
const body = htmlSafe( const body = this.currentUser?.can_send_private_messages
I18n.t("user.no_messages_body", { ? htmlSafe(
aboutUrl: getURL("/about"), I18n.t("user.no_messages_body", {
icon: iconHTML("envelope"), aboutUrl: getURL("/about"),
}) icon: iconHTML("envelope"),
); })
)
: "";
return { title, body }; return { title, body };
}, },