Skip to content

Commit

Permalink
Fix for elementary#529 Appcenter sometimes opens the updates view.
Browse files Browse the repository at this point in the history
This also fix an issue where installed apps would not show up if your did not open the AppListUpdateView until the update worker ended.
  • Loading branch information
italo-capasso committed Dec 22, 2024
1 parent 0a7e541 commit 9be7fd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ public class AppCenter.App : Gtk.Application {

if (show_updates) {
((MainWindow) active_window).go_to_installed ();
show_updates = false;
}

active_window.present ();
Expand Down
16 changes: 8 additions & 8 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ public class AppCenter.MainWindow : Gtk.ApplicationWindow {
backend.notify["job-type"].connect (update_overlaybar_label);

overlaybar.label = backend.job_type.to_string ();

if (installed_view == null) {
installed_view = new Views.AppListUpdateView ();

installed_view.show_app.connect ((package) => {
show_package (package);
});
}
}

public override bool close_request () {
Expand Down Expand Up @@ -192,14 +200,6 @@ public class AppCenter.MainWindow : Gtk.ApplicationWindow {
}

public void go_to_installed () {
if (installed_view == null) {
installed_view = new Views.AppListUpdateView ();

installed_view.show_app.connect ((package) => {
show_package (package);
});
}

if (installed_view.parent != null) {
navigation_view.pop_to_page (installed_view);
} else {
Expand Down

0 comments on commit 9be7fd2

Please sign in to comment.