FIX: do not add personal message link in user menu if they are disabled

This commit is contained in:
Jeff Wong 2019-11-01 22:39:59 -07:00
parent 66e0bdc053
commit 29ee467a04
1 changed files with 10 additions and 5 deletions

View File

@ -29,7 +29,7 @@ createWidgetFrom(QuickAccessPanel, "quick-access-profile", {
}, },
_getDefaultItems() { _getDefaultItems() {
return [ let defaultItems = [
{ {
icon: "user", icon: "user",
href: `${this.attrs.path}/summary`, href: `${this.attrs.path}/summary`,
@ -39,12 +39,16 @@ createWidgetFrom(QuickAccessPanel, "quick-access-profile", {
icon: "stream", icon: "stream",
href: `${this.attrs.path}/activity`, href: `${this.attrs.path}/activity`,
content: I18n.t("user.activity_stream") content: I18n.t("user.activity_stream")
}, }
{ ];
if (this.siteSettings.enable_personal_messages) {
defaultItems.push({
icon: "envelope", icon: "envelope",
href: `${this.attrs.path}/messages`, href: `${this.attrs.path}/messages`,
content: I18n.t("user.private_messages") content: I18n.t("user.private_messages")
}, });
}
defaultItems.push(
{ {
icon: "pencil", icon: "pencil",
href: `${this.attrs.path}/activity/drafts`, href: `${this.attrs.path}/activity/drafts`,
@ -55,7 +59,8 @@ createWidgetFrom(QuickAccessPanel, "quick-access-profile", {
href: `${this.attrs.path}/preferences`, href: `${this.attrs.path}/preferences`,
content: I18n.t("user.preferences") content: I18n.t("user.preferences")
} }
]; );
return defaultItems;
}, },
_toggleAnonymousButton() { _toggleAnonymousButton() {