mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-19 17:58:43 -05:00
fix: handle empty queue case to prevent loading state hang (#1863)
refs: QMFE-CORE-17 Signed-off-by: Johan Enell <johan.enell@qlik.com>
This commit is contained in:
@@ -32,10 +32,14 @@ export default function useItemsLoader({
|
||||
clearTimeout(local.current.timeout);
|
||||
setIsLoading(true);
|
||||
return new Promise((resolve) => {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
local.current.timeout = setTimeout(
|
||||
() => {
|
||||
const lastItemInQueue = local.current.queue.slice(-1)[0];
|
||||
if (!lastItemInQueue) {
|
||||
setIsLoading(false);
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
const reqPromise = model
|
||||
.getListObjectData(
|
||||
'/qListObjectDef',
|
||||
|
||||
Reference in New Issue
Block a user