Browse Source

HUE-406. Prevent Hue from fetching and displaying login box twice.

Aaron Newton 15 years ago
parent
commit
ed42db6a33

+ 1 - 0
desktop/core/static/js/Source/Hue/Hue.Desktop.js

@@ -563,6 +563,7 @@ Hue.Desktop = CCS.Desktop = {
 	getState: function(){
 		//only get this once; it's syncronous
 		if (this._fetchedState) return this._fetchedState;
+		if (!Hue.User.isLoggedIn()) return null;
 		var result;
 		var jsonRequest = new Request.JSON({
 			url: this.prefsUrl,

+ 5 - 0
desktop/core/static/js/Source/Hue/Hue.User.js

@@ -51,6 +51,11 @@ script: Hue.User.js
 					}).send();
 				}
 			}
+		},
+
+		isLoggedIn: function(){
+			return !!data;
 		}
+
 	};
 })();