]> source.dussan.org Git - vaadin-framework.git/commitdiff
Do not restart application if messages are received (#16868)
authorArtur Signell <artur@vaadin.com>
Fri, 20 Feb 2015 20:48:50 +0000 (22:48 +0200)
committerArtur Signell <artur@vaadin.com>
Wed, 25 Feb 2015 11:07:10 +0000 (13:07 +0200)
Change-Id: I5ede5efb7ae9a171fac79f2ead98e2fb12c249c4

client/src/com/vaadin/client/ApplicationConnection.java

index e7bbb6530029411d0f75c4163fb0ffdc2885c3fe..8c03f3fdaa8486ae28d51920c24ff6e4dbbd2668 100644 (file)
@@ -62,7 +62,6 @@ import com.google.gwt.user.client.Window.ClosingHandler;
 import com.google.gwt.user.client.ui.HasWidgets;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.client.ApplicationConfiguration.ErrorMessage;
-import com.vaadin.client.ApplicationConnection.ApplicationStoppedEvent;
 import com.vaadin.client.ResourceLoader.ResourceLoadEvent;
 import com.vaadin.client.ResourceLoader.ResourceLoadListener;
 import com.vaadin.client.communication.HasJavaScriptConnectorHelper;
@@ -1062,8 +1061,17 @@ public class ApplicationConnection implements HasHandlers {
         if (isApplicationRunning()) {
             handleReceivedJSONMessage(start, jsonText, json);
         } else {
-            setApplicationRunning(true);
-            handleWhenCSSLoaded(jsonText, json);
+            if (!cssLoaded) {
+                // Application is starting up for the first time
+                setApplicationRunning(true);
+                handleWhenCSSLoaded(jsonText, json);
+            } else {
+                getLogger()
+                        .warning(
+                                "Ignored received message because application has already been stopped");
+                return;
+
+            }
         }
     }