fix: downgrade notification when the window is not visible

This commit is contained in:
Vinicius Moreira
2019-08-27 16:48:46 -03:00
parent 7b3f21652b
commit caf5ac4883
2 changed files with 4 additions and 5 deletions

View File

@@ -139,9 +139,9 @@ class DowngradeApp(AsyncAction):
success = False
self.print(self.locale_keys['internet.required'])
finally:
self.notify_finished({'app': self.app, 'success': success})
self.app = None
self.root_password = None
self.notify_finished(success)
class GetAppInfo(AsyncAction):

View File

@@ -368,13 +368,12 @@ class ManageWindow(QWidget):
def _can_notify_user(self):
return self.isHidden() or self.isMinimized()
def _finish_downgrade(self, success: bool):
def _finish_downgrade(self, res: dict):
self.finish_action()
if success:
if res['success']:
if self._can_notify_user():
app = self.table_apps.get_selected_app()
util.notify_user('{} ({}) {}'.format(app.model.base_data.name, app.model.get_type(), self.locale_keys['downgraded']))
util.notify_user('{} {}'.format(res['app'], self.locale_keys['downgraded']))
self.refresh_apps()