[chrome-gnome-shell] api: claim v6 API only if supported by connector.



commit 88d1c0af26f92dbc242193d1c205c2fad8dd9f63
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Mon Jan 7 21:28:59 2019 +0400

    api: claim v6 API only if supported by connector.

 connector/chrome-gnome-shell.py     |  2 +-
 extension/include/sweettooth-api.js | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/connector/chrome-gnome-shell.py b/connector/chrome-gnome-shell.py
index 003bfc9..1829726 100755
--- a/connector/chrome-gnome-shell.py
+++ b/connector/chrome-gnome-shell.py
@@ -412,7 +412,7 @@ class ChromeGNOMEShell(Gio.Application):
                 else:
                     disable_user_extensions = False
 
-                supports = ['notifications', "update-enabled"]
+                supports = ['notifications', "update-enabled", 'v6']
                 if REQUESTS_IMPORTED:
                     supports.append('update-check')
 
diff --git a/extension/include/sweettooth-api.js b/extension/include/sweettooth-api.js
index 1f70a9d..83d5e55 100644
--- a/extension/include/sweettooth-api.js
+++ b/extension/include/sweettooth-api.js
@@ -28,7 +28,7 @@ GSC.getMessage = function (key) {
 
 window.SweetTooth = function () {
        var apiObject = {
-               apiVersion: 6,
+               apiVersion: 5,
                shellVersion: '-1',
                versionValidationEnabled: true,
                userExtensionsDisabled: false,
@@ -115,7 +115,8 @@ window.SweetTooth = function () {
                                apiObject.userExtensionsDisabled = response.userExtensionsDisabled;
 
                                let REQUIRED_APIS = [
-                                       "notifications"
+                                       "notifications",
+                                       "v6"
                                ];
 
                                if(response.supports)
@@ -127,6 +128,11 @@ window.SweetTooth = function () {
                                                {
                                                        REQUIRED_APIS.splice(api_index, 1);
                                                }
+
+                                               if(api === 'v6')
+                                               {
+                                                       apiObject.apiVersion = 6;
+                                               }
                                        }
                                }
 


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