diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js index 75f420373..9050b8a50 100644 --- a/js/ui/components/networkAgent.js +++ b/js/ui/components/networkAgent.js @@ -604,12 +604,17 @@ var NetworkAgent = new Lang.Class({ this._native.connect('new-request', this._newRequest.bind(this)); this._native.connect('cancel-request', this._cancelRequest.bind(this)); - try { - this._native.init(null); - } catch(e) { - this._native = null; - logError(e, 'error initializing the NetworkManager Agent'); - } + + this._initialized = false; + this._native.init_async(GLib.PRIORITY_DEFAULT, null, (o, res) => { + try { + this._native.init_finish(res); + this._initialized = true; + } catch(e) { + this._native = null; + logError(e, 'error initializing the NetworkManager Agent'); + } + }); }, enable() { @@ -617,7 +622,7 @@ var NetworkAgent = new Lang.Class({ return; this._native.auto_register = true; - if (!this._native.registered) + if (this._initialized && !this._native.registered) this._native.register_async(null, null); }, @@ -640,7 +645,7 @@ var NetworkAgent = new Lang.Class({ return; this._native.auto_register = false; - if (this._native.registered) + if (this._initialized && this._native.registered) this._native.unregister_async(null, null); }, diff --git a/meson.build b/meson.build index bfc2ff76c..1c0b68c71 100644 --- a/meson.build +++ b/meson.build @@ -31,7 +31,7 @@ ibus_req = '>= 1.5.2' bt_req = '>= 3.9.0' gst_req = '>= 0.11.92' -nm_req = '>= 0.9.8' +nm_req = '>= 1.10.4' secret_req = '>= 0.18' gnome = import('gnome')