Просмотр исходного кода

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
Nino van Hooff 4 лет назад
Родитель
Сommit
c815b098d4
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      plugins/Toolbox/src/CloudSync/CloudPackageChecker.py

+ 10 - 0
plugins/Toolbox/src/CloudSync/CloudPackageChecker.py

@@ -106,6 +106,16 @@ class CloudPackageChecker(QObject):
         # 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))
 
+        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:
             account = self._application.getCuraAPI().account
             account.setUpdatePackagesAction(lambda: self._onSyncButtonClicked(None, None))