Skip to content

Commit

Permalink
Suppress compatibility warnings during app installation (#101)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
csadorf authored Jul 27, 2022
1 parent 63236dc commit 5b7d68e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions home/app_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -374,6 +378,8 @@ def _refresh_widget_state(self, _=None):
self.issue_indicator.value = f'<i class="fa fa-{warn_or_ban_icon}"></i> Unable to reach the registry server.'
elif not registered:
self.issue_indicator.value = f'<i class="fa fa-{warn_or_ban_icon}"></i> The app is not registered.'
elif busy:
self.issue_indicator.value = ""
elif detached:
self.issue_indicator.value = (
f'<i class="fa fa-{warn_or_ban_icon}"></i> The app has local modifications or was checked out '
Expand All @@ -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(
Expand Down Expand Up @@ -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."""
Expand All @@ -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."""
Expand Down

0 comments on commit 5b7d68e

Please sign in to comment.