From 6e9dd0c71064e904bf85911eae844d6f6e0bf17d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 10 Oct 2024 22:15:58 -0700 Subject: [PATCH] SystemUpdate: make sure we notify if network is metered (#164) --- src/Backends/SystemUpdate.vala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Backends/SystemUpdate.vala b/src/Backends/SystemUpdate.vala index d2ef61d1..e8902632 100644 --- a/src/Backends/SystemUpdate.vala +++ b/src/Backends/SystemUpdate.vala @@ -119,12 +119,15 @@ public class SettingsDaemon.Backends.SystemUpdate : Object { update_state (AVAILABLE); - if (!force && !NetworkMonitor.get_default ().network_metered && settings.get_boolean ("automatic-updates")) { + var metered_network = NetworkMonitor.get_default ().network_metered; + var auto_updates = settings.get_boolean ("automatic-updates"); + + if (!force && !metered_network && auto_updates) { update.begin (); return; } - if (notify) { + if (notify || (metered_network && auto_updates)) { var notification = new Notification (_("Update available")); notification.set_default_action (Application.ACTION_PREFIX + Application.SHOW_UPDATES_ACTION);