egw.preference(name, app, true) returns now a promise to query preference async

changed notifications to query preference async together with lang-files
fixed error-handling in new egw.json()
This commit is contained in:
Ralf Becker
2021-07-16 14:50:06 +02:00
parent 87694e660c
commit ce0a513187
3 changed files with 36 additions and 17 deletions

View File

@ -285,7 +285,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
})
}
const date = typeof response.headers === 'object' ? 'Date: '+response.headers.get('Date') :
response.getAllResponseHeaders().match(/^Date:.*$/mi)[0] ||
(typeof response.getAllResponseHeaders === 'function' ? response.getAllResponseHeaders().match(/^Date:.*$/mi)[0] : null) ||
'Date: '+(new Date).toString();
this.egw.message.call(this.egw,
this.egw.lang('A request to the EGroupware server returned with an error')+
@ -416,7 +416,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
}
}
// Call request callback, if provided
if(this.callback != null && !only_data)
if(typeof this.callback === 'function' && !only_data)
{
this.callback.call(this.context,res);
}