From 5b7d68e099549113a0249eaad1916fccca36de80 Mon Sep 17 00:00:00 2001 From: Carl Simon Adorf Date: Wed, 27 Jul 2022 10:32:16 +0200 Subject: [PATCH] Suppress compatibility warnings during app installation (#101) The app manager will sometimes falsely report that the checked out version is detached during the installation process because the widget refresh is triggered while the git clone/checkout process is still ongoing. With this fix, the message is suppressed while the widget is busy. --- home/app_manager.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/home/app_manager.py b/home/app_manager.py index c0ffbbb..f4dd289 100644 --- a/home/app_manager.py +++ b/home/app_manager.py @@ -260,7 +260,11 @@ def _refresh_widget_state(self, _=None): # Check app compatibility and show banner if not compatible. self.compatibility_warning.layout.visibility = ( "visible" - if (self.app.is_installed() and self.app.compatible is False) + if ( + not busy + and self.app.is_installed() + and self.app.compatible is False + ) else "hidden" ) @@ -374,6 +378,8 @@ def _refresh_widget_state(self, _=None): self.issue_indicator.value = f' Unable to reach the registry server.' elif not registered: self.issue_indicator.value = f' The app is not registered.' + elif busy: + self.issue_indicator.value = "" elif detached: self.issue_indicator.value = ( f' The app has local modifications or was checked out ' @@ -388,7 +394,8 @@ def _refresh_widget_state(self, _=None): ) if ( - any(self.app.compatibility_info.values()) + not busy + and any(self.app.compatibility_info.values()) and self.app.compatible is False ): self.compatibility_info.value = self.COMPATIBILITY_INFO.render( @@ -429,6 +436,7 @@ def _install_version(self, _=None): self._show_msg_success( f"Installed app ({self._formatted_version(version)})." ) + self.dependencies_log.value = "" def _update_app(self, _): """Attempt to update the app.""" @@ -439,6 +447,7 @@ def _update_app(self, _): self._show_msg_failure(str(error)) else: self._show_msg_success("Updated app.") + self.dependencies_log.value = "" def _uninstall_app(self, _): """Attempt to uninstall the app."""