File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/itwin/tree-widget/src/tree-widget-react/components/trees/categories-tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ export function useCategoriesTree({
82
82
83
83
const { visibilityHandlerFactory, onFilteredPathsChanged } = useCategoriesCachedVisibility ( {
84
84
activeView,
85
+ viewType,
85
86
getCache : getCategoriesTreeIdsCache ,
86
87
} ) ;
87
88
@@ -163,9 +164,8 @@ function getSublabel(node: PresentationHierarchyNode) {
163
164
return node . nodeData . extendedData ?. description ;
164
165
}
165
166
166
- function useCategoriesCachedVisibility ( props : { activeView : Viewport ; getCache : ( ) => CategoriesTreeIdsCache } ) {
167
- const { activeView, getCache } = props ;
168
- const filteredTreeProps = getClassesByView ( activeView . view . is2d ( ) ? "2d" : "3d" ) ;
167
+ function useCategoriesCachedVisibility ( props : { activeView : Viewport ; getCache : ( ) => CategoriesTreeIdsCache ; viewType : "2d" | "3d" } ) {
168
+ const { activeView, getCache, viewType } = props ;
169
169
const { visibilityHandlerFactory, filteredPaths, onFilteredPathsChanged } = useCachedVisibility <
170
170
CategoriesTreeIdsCache ,
171
171
CategoriesTreeFilterTargets ,
@@ -174,7 +174,7 @@ function useCategoriesCachedVisibility(props: { activeView: Viewport; getCache:
174
174
> ( {
175
175
activeView,
176
176
getCache,
177
- filteredTreeProps,
177
+ filteredTreeProps : useMemo ( ( ) => getClassesByView ( viewType ) , [ viewType ] ) ,
178
178
createFilteredTree,
179
179
treeSpecificVisibilityHandlerProps : undefined ,
180
180
createTreeSpecificVisibilityHandler,
You can’t perform that action at this time.
0 commit comments