Api: Always resolve jsonq, even if empty array

Fixes callback was not called if response was []
This commit is contained in:
nathan 2023-04-25 09:10:33 -06:00
parent 5b9cf0ae0b
commit 7a75f50362

View File

@ -110,6 +110,11 @@ egw.extend('jsonq', egw.MODULE_GLOBAL, function()
json.handleResponse({response: response}); json.handleResponse({response: response});
} }
} }
// Response is there, but empty. Make sure to resolve it or the callback doesn't get called.
if (typeof response.length !== "undefined" && response.length == 0)
{
job.resolve();
}
} }
delete jsonq_queue[uid]; delete jsonq_queue[uid];