+++ /dev/null
-'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
$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');