Remove menu controller.
authorCameron Ball <cameron@getapproved.com.au>
Fri, 5 Dec 2014 06:58:39 +0000 (14:58 +0800)
committerCameron Ball <cameron@getapproved.com.au>
Fri, 5 Dec 2014 06:58:39 +0000 (14:58 +0800)
app/components/menu/menu-controller.js [deleted file]
app/components/simfiles/simfile-directive.js

diff --git a/app/components/menu/menu-controller.js b/app/components/menu/menu-controller.js
deleted file mode 100644 (file)
index 8514909..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-'use strict';
-
-angular.module("DivinElegy.components.menu", ["DivinElegy.components.hello", "DivinElegy.components.user"]).
-    
-controller("MenuController", ['$scope', 'HelloService', function($scope, HelloService)
-{    
-    $scope.doLogin = function()
-    {
-        HelloService.facebookLogin();
-    };
-    
-    $scope.doLogout = function()
-    {
-        HelloService.logout('facebook');
-    };
-}]);
\ No newline at end of file
index 0ae81c0..7f42793 100644 (file)
@@ -45,11 +45,17 @@ directive('simfile', ['$rootScope', 'UserService', 'HelloService', 'rockEndpoint
 
             $scope.downloadFromDe = function(simfile)
             {      
+                if(!UserService.getCurrentUser())
+                {
+                    $rootScope.$broadcast('message.error', 'You need to be logged in to download from DivinElegy.'); 
+                    return;
+                }
+                
                 UserService.getCurrentUser().then(function(user)
                 {
                     var size = filesizeBytes(simfile.size);
                     var quotaRemaining = filesizeBytes(user.quotaRemaining);
-                console.log('here');
+
                     if(quotaRemaining < size)
                     {
                         $rootScope.$broadcast('message.error', 'Sorry, you do not have enough quota to download that file. Quota resets at 00:00 UTC+0');