DEV: Use `@cached` decorator in `user-menu/menu` (#21558)
This commit is contained in:
parent
3e1915383d
commit
e25468b2ca
|
@ -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) => {
|
||||||
|
|
Loading…
Reference in New Issue