Skip to content

Commit a024fce

Browse files
committed
#RI-3894 - [FE] Keys from previously selected folder are still displayed when this subfolder not found after filter by type
#RI-3895 - [FE] Deleted key from non-existing folder is displayed after refresh
1 parent 93c1c1b commit a024fce

File tree

4 files changed

+495
-3
lines changed

4 files changed

+495
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import { EuiIcon, EuiLoadingSpinner } from '@elastic/eui'
1010
import { useDispatch } from 'react-redux'
1111

12-
import { getTreeLeafField, Maybe } from 'uiSrc/utils'
12+
import { findTreeNode, getTreeLeafField, Maybe } from 'uiSrc/utils'
1313
import { useDisposableWebworker } from 'uiSrc/services'
1414
import { IKeyPropTypes } from 'uiSrc/constants/prop-types/keys'
1515
import { ThemeContext } from 'uiSrc/contexts/themeContext'
@@ -118,7 +118,7 @@ const VirtualTree = (props: Props) => {
118118
}
119119

120120
// if selected Keys folder is not exists (after a new search) needs reset Browser state
121-
const selectedLeafExists = !!nodes.find((node) => Object.keys(statusSelected)?.[0]?.startsWith(node.fullName))
121+
const selectedLeafExists = !!findTreeNode(nodes, Object.keys(statusSelected)?.[0], 'fullName')
122122

123123
if (!selectedLeafExists) {
124124
dispatch(resetBrowserTree())

0 commit comments

Comments
 (0)