diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/core/overrides/Gio.js | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/modules/core/overrides/Gio.js b/modules/core/overrides/Gio.js index 1fab4796..becefa03 100644 --- a/modules/core/overrides/Gio.js +++ b/modules/core/overrides/Gio.js @@ -247,19 +247,8 @@ function _makeProxyWrapper(interfaceXml) { if (!cancellable) cancellable = null; if (asyncCallback) { - obj.init_async(GLib.PRIORITY_DEFAULT, cancellable, (initable, result) => { - let caughtErrorWhenInitting = null; - try { - initable.init_finish(result); - } catch (e) { - caughtErrorWhenInitting = e; - } - - if (caughtErrorWhenInitting === null) - asyncCallback(initable, null); - else - asyncCallback(null, caughtErrorWhenInitting); - }); + obj.init_async(GLib.PRIORITY_DEFAULT, cancellable).then( + () => asyncCallback(obj, null)).catch(e => asyncCallback(null, e)); } else { obj.init(cancellable); } |