VulpesOS/gaia/shared/js/fb/fb_request.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

39 lines
925 B
JavaScript
Executable file

'use strict';
var fb = self.fb || {};
self.fb = fb;
// Only will be executed in the case of not loading fb.utils previously
// i.e. dialer and call log FB integration
fb.utils = self.fb.utils || {};
self.fb.utils = fb.utils;
if (typeof fb.utils.Request !== 'function') {
/**
* Request auxiliary object to support asynchronous calls
*
*/
fb.utils.Request = function() {
this.done = function(result) {
this.result = result;
if (typeof this.onsuccess === 'function') {
var ev = {};
ev.target = this;
window.setTimeout(function() {
this.onsuccess(ev);
}.bind(this), 0);
}
};
this.failed = function(error) {
this.error = error;
if (typeof this.onerror === 'function') {
var ev = {};
ev.target = this;
window.setTimeout(function() {
this.onerror(ev);
}.bind(this), 0);
}
};
};
}