[polari] urlPreview: Do not generate thumbnails on metered connections



commit 556bb90abf8aee1099d2de786a10925f8ae24441
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jul 28 02:27:01 2020 +0200

    urlPreview: Do not generate thumbnails on metered connections
    
    When the network connection is metered, we should avoid any
    non-essential traffic. That certainly applies to URL previews,
    so treat metered connections the same as no connectivity and
    delay thumbnail generation until we get unmetered network access.
    
    https://gitlab.gnome.org/GNOME/polari/-/issues/149

 src/urlPreview.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/urlPreview.js b/src/urlPreview.js
index 3e8e4de1..44fef4a3 100644
--- a/src/urlPreview.js
+++ b/src/urlPreview.js
@@ -21,7 +21,7 @@ class Thumbnailer {
 
     get _hasNetwork() {
         const monitor = Gio.NetworkMonitor.get_default();
-        return monitor.state_valid && monitor.network_available;
+        return monitor.state_valid && monitor.network_available && !monitor.network_metered;
     }
 
     getThumbnail(uri) {


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