Skip to content

Commit 1e448ee

Browse files
committed
Merge branch 'main' into e2e/bugfix/fixes-for-unstable-tests
2 parents 2371011 + 90fdb96 commit 1e448ee

File tree

1 file changed

+12
-1
lines changed
  • redisinsight/ui/src/pages/browser/components/key-list

1 file changed

+12
-1
lines changed

redisinsight/ui/src/pages/browser/components/key-list/KeyList.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ const KeyList = forwardRef((props: Props, ref) => {
7575
const { keyList: { scrollTopPosition } } = useSelector(appContextBrowser)
7676

7777
const [, rerender] = useState({})
78+
const [firstDataLoaded, setFirstDataLoaded] = useState(!!keysState.keys.length)
7879

7980
const itemsRef = useRef(keysState.keys)
81+
const isNotRendered = useRef(true)
8082
const renderedRowsIndexesRef = useRef({ startIndex: 0, lastIndex: 0 })
8183

8284
const dispatch = useDispatch()
@@ -99,6 +101,12 @@ const KeyList = forwardRef((props: Props, ref) => {
99101

100102
useEffect(() => {
101103
itemsRef.current = [...keysState.keys]
104+
105+
if (!isNotRendered.current && !loading) {
106+
setFirstDataLoaded(true)
107+
}
108+
109+
isNotRendered.current = false
102110
if (itemsRef.current.length === 0) {
103111
rerender({})
104112
return
@@ -135,6 +143,9 @@ const KeyList = forwardRef((props: Props, ref) => {
135143
}
136144

137145
const getNoItemsMessage = () => {
146+
if (isNotRendered.current) {
147+
return ''
148+
}
138149
if (total === 0) {
139150
return NoKeysToDisplayText(Pages.workbench(instanceId), onNoKeysLinkClick)
140151
}
@@ -371,7 +382,7 @@ const KeyList = forwardRef((props: Props, ref) => {
371382
columns={columns}
372383
loadMoreItems={onLoadMoreItems}
373384
onWheel={onWheelSearched}
374-
loading={loading}
385+
loading={loading || !firstDataLoaded}
375386
items={itemsRef.current}
376387
totalItemsCount={keysState.total ? keysState.total : Infinity}
377388
scanned={isSearched || isFiltered ? keysState.scanned : 0}

0 commit comments

Comments
 (0)