Skip to content

Commit

Permalink
SystemUpdate: make sure we notify if network is metered (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Oct 11, 2024
1 parent 157ffd0 commit 6e9dd0c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Backends/SystemUpdate.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 6e9dd0c

Please sign in to comment.