Skip to content

Commit 6ccc0a7

Browse files
committed
#RI-5258 - fix key type for tree view
1 parent 6a510a3 commit 6ccc0a7

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

redisinsight/ui/src/pages/browser/components/virtual-tree/VirtualTree.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,18 @@ const VirtualTree = (props: Props) => {
136136
}), [])
137137

138138
const getMetadata = useCallback((
139-
itemsInit: any[] = []
139+
itemsInit: any[] = [],
140+
filter: Nullable<KeyTypes>
140141
): void => {
141142
dispatch(fetchKeysMetadataTree(
142143
itemsInit,
143-
commonFilterType,
144+
filter,
144145
controller.current?.signal,
145146
(loadedItems) =>
146147
onSuccessFetchedMetadata(loadedItems),
147148
() => { rerender({}) }
148149
))
149-
}, [commonFilterType])
150+
}, [])
150151

151152
const onSuccessFetchedMetadata = (
152153
loadedItems: any[],
@@ -158,18 +159,18 @@ const VirtualTree = (props: Props) => {
158159
rerender({})
159160
}
160161

161-
const getMetadataDebounced = debounce(() => {
162+
const getMetadataDebounced = debounce((filter: Nullable<KeyTypes>) => {
162163
const entries = Object.entries(elements.current)
163164

164-
getMetadata(entries)
165+
getMetadata(entries, filter)
165166

166167
elements.current = {}
167168
}, 100)
168169

169170
const getMetadataNode = useCallback((nameBuffer: any, path: string) => {
170171
elements.current[path] = nameBuffer
171-
getMetadataDebounced()
172-
}, [])
172+
getMetadataDebounced(commonFilterType)
173+
}, [commonFilterType])
173174

174175
// This helper function constructs the object that will be sent back at the step
175176
// [2] during the treeWalker function work. Except for the mandatory `data`

0 commit comments

Comments
 (0)