mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Use @cached decorator in user-menu/menu (#21558)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import Component from "@glimmer/component";
|
import Component from "@glimmer/component";
|
||||||
import { tracked } from "@glimmer/tracking";
|
import { cached, tracked } from "@glimmer/tracking";
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
import { NO_REMINDER_ICON } from "discourse/models/bookmark";
|
import { NO_REMINDER_ICON } from "discourse/models/bookmark";
|
||||||
import UserMenuTab, { CUSTOM_TABS_CLASSES } from "discourse/lib/user-menu/tab";
|
import UserMenuTab, { CUSTOM_TABS_CLASSES } from "discourse/lib/user-menu/tab";
|
||||||
@@ -189,13 +189,8 @@ export default class UserMenu extends Component {
|
|||||||
@tracked currentPanelComponent = DEFAULT_PANEL_COMPONENT;
|
@tracked currentPanelComponent = DEFAULT_PANEL_COMPONENT;
|
||||||
@tracked currentNotificationTypes;
|
@tracked currentNotificationTypes;
|
||||||
|
|
||||||
constructor() {
|
@cached
|
||||||
super(...arguments);
|
get topTabs() {
|
||||||
this.topTabs = this._topTabs;
|
|
||||||
this.bottomTabs = this._bottomTabs;
|
|
||||||
}
|
|
||||||
|
|
||||||
get _topTabs() {
|
|
||||||
const tabs = [];
|
const tabs = [];
|
||||||
|
|
||||||
CORE_TOP_TABS.forEach((tabClass) => {
|
CORE_TOP_TABS.forEach((tabClass) => {
|
||||||
@@ -236,7 +231,8 @@ export default class UserMenu extends Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get _bottomTabs() {
|
@cached
|
||||||
|
get bottomTabs() {
|
||||||
const tabs = [];
|
const tabs = [];
|
||||||
|
|
||||||
CORE_BOTTOM_TABS.forEach((tabClass) => {
|
CORE_BOTTOM_TABS.forEach((tabClass) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user