From 686d899bb7586691cacb795f5e2486eb8c079cc2 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Wed, 29 Feb 2012 10:33:05 -0800 Subject: [PATCH] Only show invitations if projects UI is initialized --- ui/scripts/ui/core.js | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/ui/scripts/ui/core.js b/ui/scripts/ui/core.js index b4da09b2281..716dedac954 100644 --- a/ui/scripts/ui/core.js +++ b/ui/scripts/ui/core.js @@ -295,24 +295,26 @@ ); // Check for pending project invitations - cloudStack.projects.invitationCheck({ - context: cloudStack.context, - response: { - success: function(args) { - if (!args.data.length) return; - - var projectList = $.map(args.data, function(invitation) { - return '
  • ' + invitation.project + '
  • '; - }).join(''); + if (args.projects) { + args.projects.invitationCheck({ + context: cloudStack.context, + response: { + success: function(args) { + if (!args.data.length) return; + + var projectList = $.map(args.data, function(invitation) { + return '
  • ' + invitation.project + '
  • '; + }).join(''); - cloudStack.dialog.notice({ - message: _l('message.pending.projects.1') + - '' + - '

    ' + _l('message.pending.projects.2') + '

    ' - }); + cloudStack.dialog.notice({ + message: _l('message.pending.projects.1') + + '' + + '

    ' + _l('message.pending.projects.2') + '

    ' + }); + } } - } - }); + }); + } // Hide logo conditionally if (!args.hasLogo) $('#header .controls').addClass('nologo');