From f6fe42fbad8e59f7fcbcc6c6bbd18d0da50f085f Mon Sep 17 00:00:00 2001 From: Leonhard Kargl Date: Thu, 15 Aug 2024 16:34:03 +0200 Subject: [PATCH] SystemUpdate: Move offline trigger to end session dialog --- src/Backends/SystemUpdate.vala | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Backends/SystemUpdate.vala b/src/Backends/SystemUpdate.vala index 674dc14b..221268d1 100644 --- a/src/Backends/SystemUpdate.vala +++ b/src/Backends/SystemUpdate.vala @@ -71,6 +71,17 @@ public class SettingsDaemon.Backends.SystemUpdate : Object { update_state (CHECKING); + try { + var prepared = Pk.offline_get_prepared_ids ().length > 0; + + if (prepared) { + update_state (RESTART_REQUIRED); + return; + } + } catch (Error e) { + warning ("Failed to get offline prepared ids: %s", e.message); + } + try { yield task.refresh_cache_async (force, null, progress_callback); } catch (Error e) { @@ -152,8 +163,6 @@ public class SettingsDaemon.Backends.SystemUpdate : Object { return; } - Pk.offline_trigger (REBOOT); - var notification = new Notification (_("Restart required")); notification.set_body (_("Please restart your system to finalize updates")); notification.set_icon (new ThemedIcon ("system-reboot"));