Fix a bug where a package sync dialog would incorrectly not be shown

1. user subscribes to a package
2. dismisses the license/unsubscribes
3. subscribes to the same packafe again

in this scenario we want to notify the user again after step 3. This was
not the case because situations in step 1 and  3 are equal and thus the
user was considered notified.

CURA-7473
This commit is contained in:
Nino van Hooff 2020-06-26 16:28:03 +02:00
parent 294afdb7ca
commit c815b098d4

View file

@ -106,6 +106,16 @@ class CloudPackageChecker(QObject):
# We check if there are packages installed in Web Marketplace but not in Cura marketplace # We check if there are packages installed in Web Marketplace but not in Cura marketplace
package_discrepancy = list(user_subscribed_packages.difference(user_installed_packages)) package_discrepancy = list(user_subscribed_packages.difference(user_installed_packages))
if user_subscribed_packages != self._last_notified_packages:
# scenario:
# 1. user subscribes to a package
# 2. dismisses the license/unsubscribes
# 3. subscribes to the same packafe again
# in this scenario we want to notify the user again. To capture that there was a change during
# step 2, we clear the last_notified after step 2. This way, the user will be notified after
# step 3 even though the list of packages for step 1 and 3 are equal
self._last_notified_packages = None
if package_discrepancy: if package_discrepancy:
account = self._application.getCuraAPI().account account = self._application.getCuraAPI().account
account.setUpdatePackagesAction(lambda: self._onSyncButtonClicked(None, None)) account.setUpdatePackagesAction(lambda: self._onSyncButtonClicked(None, None))