From 2703eed446e7333cd8e1fa5371baf08f72e49c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 30 Nov 2019 06:01:44 +0100 Subject: [PATCH] extensionPrefs: Simplify state change handling The new `ExtensionStateChanged` signal already passes the changed extension object, no need to request it again with `GetExtensionInfo`. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/873 --- js/extensionPrefs/main.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js index 163d6dbfe..387f7f325 100644 --- a/js/extensionPrefs/main.js +++ b/js/extensionPrefs/main.js @@ -258,23 +258,15 @@ class Application extends Gtk.Application { } _onExtensionStateChanged(proxy, senderName, [uuid, newState]) { + let extension = ExtensionUtils.deserializeExtension(newState); let row = this._findExtensionRow(uuid); + if (row) { - let { state } = ExtensionUtils.deserializeExtension(newState); - if (state == ExtensionState.UNINSTALLED) + if (extension.state === ExtensionState.UNINSTALLED) row.destroy(); return; // we only deal with new and deleted extensions here } - - this._shellProxy.GetExtensionInfoRemote(uuid, ([serialized]) => { - let extension = ExtensionUtils.deserializeExtension(serialized); - if (!extension) - return; - // check the extension wasn't added in between - if (this._findExtensionRow(uuid) != null) - return; - this._addExtensionRow(extension); - }); + this._addExtensionRow(extension); } _scanExtensions() {