summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xclient/js/controllers/home/home.js13
-rwxr-xr-xclient/js/controllers/image/image.js9
2 files changed, 7 insertions, 15 deletions
diff --git a/client/js/controllers/home/home.js b/client/js/controllers/home/home.js
index aeb89e5..8ec4c95 100755
--- a/client/js/controllers/home/home.js
+++ b/client/js/controllers/home/home.js
@@ -5,7 +5,6 @@
*/
mainApp.controller('homeCtrl', ['$scope', 'Compute', '$rootScope', 'Loading', 'Identity', 'Image', function ($scope, Compute, $rootScope, Loading, Identity, Image)
{
-
graph = new joint.dia.Graph;
paper = new joint.dia.Paper({
el: $('#graphHolder'),
@@ -87,18 +86,14 @@ mainApp.controller('homeCtrl', ['$scope', 'Compute', '$rootScope', 'Loading', 'I
var tryToRetrieveData = function () {
// If no data retrieve about machine and user is logged
- if (Compute.getData().machines == null && Identity.isAlreadyLogin()) {
+ if (Identity.isAlreadyLogin()) {
Loading.start(); // Show loading gif
Compute.pullData(callMeAfterPullData); // Retrieve data and call the callback
- } else {
- // Else if user is logged and data is already retrieve
- // simply display data
- if (Identity.isAlreadyLogin()) {
- callMeAfterPullData(); // Display data
- }
- }
+ }
};
+ tryToRetrieveData();
+
// On user login
$scope.$on('loginEvent', function () {
tryToRetrieveData();
diff --git a/client/js/controllers/image/image.js b/client/js/controllers/image/image.js
index b402b52..5bafa88 100755
--- a/client/js/controllers/image/image.js
+++ b/client/js/controllers/image/image.js
@@ -14,12 +14,9 @@ mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity', '$roo
// If user is login try to retrieve data
if (Identity.isAlreadyLogin()) {
- if (Image.getData().images == null) {
- Loading.start();
- Image.getImages(callMeAfterGetImage);
- } else {
- callMeAfterGetImage();
- }
+ Loading.start();
+ Image.getImages(callMeAfterGetImage);
+
}
// Manager logout event