UX: Don't display group messages link for group with no messages. (#14453)

This commit is contained in:
Alan Guo Xiang Tan 2021-09-29 10:18:56 +08:00 committed by GitHub
parent 7bc0700930
commit 9998090e5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -87,12 +87,16 @@ export default Controller.extend({
return defaultTabs;
},
@discourseComputed("model.is_group_user")
showMessages(isGroupUser) {
@discourseComputed("model.has_messages", "model.is_group_user")
showMessages(hasMessages, isGroupUser) {
if (!this.siteSettings.enable_personal_messages) {
return false;
}
if (!hasMessages) {
return false;
}
return isGroupUser || (this.currentUser && this.currentUser.admin);
},

View File

@ -1317,6 +1317,7 @@ export default {
user_count: 8,
alias_level: 99,
visible: true,
has_messages: true,
public_admission: true,
public_exit: false,
flair_url: "fa-adjust",