@@ -75,8 +75,10 @@ const KeyList = forwardRef((props: Props, ref) => {
75
75
const { keyList : { scrollTopPosition } } = useSelector ( appContextBrowser )
76
76
77
77
const [ , rerender ] = useState ( { } )
78
+ const [ firstDataLoaded , setFirstDataLoaded ] = useState ( ! ! keysState . keys . length )
78
79
79
80
const itemsRef = useRef ( keysState . keys )
81
+ const isNotRendered = useRef ( true )
80
82
const renderedRowsIndexesRef = useRef ( { startIndex : 0 , lastIndex : 0 } )
81
83
82
84
const dispatch = useDispatch ( )
@@ -99,6 +101,12 @@ const KeyList = forwardRef((props: Props, ref) => {
99
101
100
102
useEffect ( ( ) => {
101
103
itemsRef . current = [ ...keysState . keys ]
104
+
105
+ if ( ! isNotRendered . current && ! loading ) {
106
+ setFirstDataLoaded ( true )
107
+ }
108
+
109
+ isNotRendered . current = false
102
110
if ( itemsRef . current . length === 0 ) {
103
111
rerender ( { } )
104
112
return
@@ -135,6 +143,9 @@ const KeyList = forwardRef((props: Props, ref) => {
135
143
}
136
144
137
145
const getNoItemsMessage = ( ) => {
146
+ if ( isNotRendered . current ) {
147
+ return ''
148
+ }
138
149
if ( total === 0 ) {
139
150
return NoKeysToDisplayText ( Pages . workbench ( instanceId ) , onNoKeysLinkClick )
140
151
}
@@ -371,7 +382,7 @@ const KeyList = forwardRef((props: Props, ref) => {
371
382
columns = { columns }
372
383
loadMoreItems = { onLoadMoreItems }
373
384
onWheel = { onWheelSearched }
374
- loading = { loading }
385
+ loading = { loading || ! firstDataLoaded }
375
386
items = { itemsRef . current }
376
387
totalItemsCount = { keysState . total ? keysState . total : Infinity }
377
388
scanned = { isSearched || isFiltered ? keysState . scanned : 0 }
0 commit comments