[chrome-gnome-shell/feature/connector-update-check: 18/18] update: use supports instead of version check



commit 2e8a042e69b6494d084db12628a3a8c656dff211
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Mon Dec 19 01:01:58 2016 +0400

    update: use supports instead of version check

 extension/include/gsc.js    |    4 ++++
 extension/include/update.js |    4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/extension/include/gsc.js b/extension/include/gsc.js
index b5d64d7..7ddc765 100644
--- a/extension/include/gsc.js
+++ b/extension/include/gsc.js
@@ -133,6 +133,10 @@ GSC = (function() {
 
                nativeNotificationsSupported: function (response) {
                        return isSupported('notifications', response);
+               },
+
+               nativeUpdateCheckSupported: function (response) {
+                       return isSupported('update-check', response);
                }
        };
 })();
diff --git a/extension/include/update.js b/extension/include/update.js
index 922cf74..d0aebee 100644
--- a/extension/include/update.js
+++ b/extension/include/update.js
@@ -27,13 +27,13 @@ GSC.update = (function($) {
        }
 
        function check() {
-               GSC.sendNativeRequest({execute: 'initialize'}, function (response) {
+               GSC.onInitialize().then(response => {
                        if (response.success)
                        {
                                var shellVersion = response.properties.shellVersion;
 
                                // TODO: remove deprecated in version 9
-                               if(response.properties.connectorVersion >= 8)
+                               if(GSC.nativeUpdateCheckSupported(response))
                                {
                                        GSC.sendNativeRequest({execute: 'checkUpdate', url: UPDATE_URL}, 
function (response) {
                                                if (response.success)


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