Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 356ffb3

Browse files
committedOct 14, 2015
Merge pull request #355 from appirio-tech/feature/hide-no-money
Feature/hide no money
2 parents a3ea1cd + 9ee862f commit 356ffb3

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed
 

‎app/my-dashboard/header-dashboard/header-dashboard.controller.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,41 @@
77
'$stateParams',
88
'NotificationService',
99
'ProfileService',
10-
'userIdentity'
10+
'userIdentity',
11+
'$log'
1112
];
1213

13-
function HeaderDashboardController($stateParams, NotificationService, ProfileService, userIdentity) {
14+
function HeaderDashboardController($stateParams, NotificationService, ProfileService, userIdentity, $log) {
1415
var vm = this;
15-
vm.loading = true;
1616

17-
if ($stateParams.notifyReset) {
18-
NotificationService.inform('Thanks. Your new password has been set.');
19-
}
2017

2118
activate();
2219

2320
function activate() {
21+
vm.loading = true;
22+
vm.hideMoney = false;
2423
var handle = userIdentity.handle;
2524

25+
if ($stateParams.notifyReset) {
26+
NotificationService.inform('Thanks. Your new password has been set.');
27+
}
28+
29+
displayMoneyEarned(handle);
30+
}
31+
32+
function displayMoneyEarned(handle) {
2633
ProfileService.getUserFinancials(handle)
2734
.then(function(financials) {
2835
vm.moneyEarned = _.sum(_.pluck(financials, 'amount'));
29-
vm.loading = false;
3036

37+
if (!vm.moneyEarned) {
38+
vm.hideMoney = true;
39+
}
40+
41+
vm.loading = false;
3142
})
3243
.catch(function(err) {
44+
vm.hideMoney = true;
3345
vm.loading = false;
3446
});
3547
}

‎app/my-dashboard/header-dashboard/header-dashboard.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ header
22
h1 My Dashboard
33

44
.user-stats(id="metrics", ng-hide="vm.loading")
5-
.money-earned
5+
.money-earned(ng-hide="vm.hideMoney")
66
p.number(ng-bind="vm.moneyEarned | currency:'$':0")
77

88
p Earned

0 commit comments

Comments
 (0)
This repository has been archived.