Switch egw.user(..., async=true) to always return a Promise for consistency

Switch Et2ButtonTimestamper to use egw.user(...,async=true)
This commit is contained in:
nathan
2022-09-20 08:05:21 -06:00
parent 82504ed158
commit 79b6cef5fd
2 changed files with 78 additions and 65 deletions

View File

@@ -122,11 +122,16 @@ egw.extend('user', egw.MODULE_GLOBAL, function()
// Synchronous
egw.json("EGroupware\\Api\\Framework::ajax_user_list",[], cache_it, this, false).sendRequest(false);
}
let result = [];
if (type === 'both')
{
return [].concat(accountStore.accounts, accountStore.groups);
result = [].concat(accountStore.accounts, accountStore.groups);
}
return [].concat(accountStore[type]);
else
{
result = [].concat(accountStore[type]);
}
return async ? Promise.resolve(result) : result;
},
/**