diff gwt-client/src/main/java/org/dive4elements/river/client/client/ui/CollectionView.java @ 8709:71ae18553377

(issue1754) Also fixup master artifact for already loaded recommendations As the load many call creates (and needs to create) all artifacts in the reccomendations this would break "old" recommendations after a reload through the "Pencil" mode. A better fix would probably be to just set the master artifiact in the recommendations but due to the extremly weird interaction with the server at this point it is not trivial to identify how this can be done.
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 24 Apr 2015 15:57:23 +0200
parents e3a63d9c5bb1
children b5ac17a10d22
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/CollectionView.java	Fri Apr 24 12:45:55 2015 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/CollectionView.java	Fri Apr 24 15:57:23 2015 +0200
@@ -721,17 +721,17 @@
         }
 
         for (final Recommendation recommendation: recommendations) {
-            if (collection.loadedRecommendation(recommendation)) {
-                continue;
-            }
-            newRecommendations.push(recommendation);
-
             // XXX: UGLY! If no reference artifact given use uuid of
             //      current artifact as reference.
             if (recommendation.getMasterArtifact() == null) {
                 recommendation.setMasterArtifact(masterArtifact.getUuid());
             }
 
+            if (collection.loadedRecommendation(recommendation)) {
+                GWT.log("Already loaded " +  recommendation.getDisplayName());
+                continue;
+            }
+            newRecommendations.push(recommendation);
         }
 
         loadArtifactService.loadMany(

http://dive4elements.wald.intevation.org