mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
89984: Fix getComponentForMenu themed method
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { DEFAULT_THEME } from '../object-collection/shared/listable-object/listable-object.decorator';
|
||||
import { MenuID } from './initial-menus-state';
|
||||
import { hasNoValue } from '../empty.util';
|
||||
import { hasNoValue, hasValue } from '../empty.util';
|
||||
|
||||
const menuComponentMap = new Map();
|
||||
|
||||
@@ -33,7 +33,9 @@ export function rendersSectionForMenu(menuID: MenuID, expandable: boolean, theme
|
||||
*/
|
||||
export function getComponentForMenu(menuID: MenuID, expandable: boolean, theme: string) {
|
||||
const comp = menuComponentMap.get(menuID).get(expandable).get(theme);
|
||||
if (hasNoValue(comp)) {
|
||||
if (hasValue(comp)) {
|
||||
return comp;
|
||||
} else {
|
||||
return menuComponentMap.get(menuID).get(expandable).get(DEFAULT_THEME);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user