[gnome-shell] extensionDownloader: Only check server if there's something to update



commit 69ea038a8ff46fa7b8ce8d5ba75b3930b753d8a0
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Mar 15 23:41:27 2020 +0100

    extensionDownloader: Only check server if there's something to update
    
    checkForUpdates() will currently always query the server for updates,
    even when passing an empty vardict of installed extensions. We know
    there won't be any updates in that case, so avoid a pointless network
    request.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1100

 js/ui/extensionDownloader.js | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/js/ui/extensionDownloader.js b/js/ui/extensionDownloader.js
index 5f6e74b09d..be7426be09 100644
--- a/js/ui/extensionDownloader.js
+++ b/js/ui/extensionDownloader.js
@@ -127,6 +127,9 @@ function checkForUpdates() {
         metadatas[uuid] = extension.metadata;
     });
 
+    if (Object.keys(metadatas).length === 0)
+        return; // nothing to update
+
     let versionCheck = global.settings.get_boolean(
         'disable-extension-version-validation');
     let params = {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]