From 7a75f5036252491e1d706203fd3e0603cc23f497 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 25 Apr 2023 09:10:33 -0600 Subject: [PATCH] Api: Always resolve jsonq, even if empty array Fixes callback was not called if response was [] --- api/js/jsapi/egw_jsonq.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/js/jsapi/egw_jsonq.js b/api/js/jsapi/egw_jsonq.js index fc8ba54569..dc21b32975 100644 --- a/api/js/jsapi/egw_jsonq.js +++ b/api/js/jsapi/egw_jsonq.js @@ -110,6 +110,11 @@ egw.extend('jsonq', egw.MODULE_GLOBAL, function() 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];