[gnome-shell] weather: Handle missing permission store



commit fea01927720e5d73e14e1649ee36cc6c60835d6f
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Apr 3 12:35:03 2019 +0200

    weather: Handle missing permission store
    
    Our weather integration is supposed to follow GNOME Weather's settings,
    including its permission to use location services. However there's a
    discrepancy in case xdg-desktop-portal is unavailable:
    
    While our geoclue agent grants all applications access to location
    services in that case, the weather integration treats it as if
    access was denied.
    
    Fix this by handling this case explicitly.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/1130

 js/misc/weather.js | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/js/misc/weather.js b/js/misc/weather.js
index aaec36cf4..e804bdee9 100644
--- a/js/misc/weather.js
+++ b/js/misc/weather.js
@@ -30,6 +30,14 @@ var WeatherClient = class {
                 return;
             }
 
+            if (this._permStore.g_name_owner == null) {
+                // Failed to auto-start, likely because xdg-desktop-portal
+                // isn't installed; don't restrict access to location service
+                this._weatherAuthorized = true;
+                this._updateAutoLocation();
+                return;
+            }
+
             this._permStore.LookupRemote('gnome', 'geolocation', (res, error) => {
                 if (error)
                     log('Error looking up permission: ' + error.message);


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