Skip to content

Commit

Permalink
UI-2253: Fixed issue with masquerading in myaccount, which wasn't upd…
Browse files Browse the repository at this point in the history
…ating badges
  • Loading branch information
JRMaitre committed Jun 9, 2016
1 parent 6c8950a commit b74376c
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions apps/myaccount/submodules/trunks/trunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,31 @@ define(function(require){
_trunksRefreshBadges: function(args) {
var self = this;

if(!args.hasOwnProperty('except') || args.except !== 'trunks') {
self.trunksGetLimits(function(dataLimits) {
var argsMenuInbound = {
module: 'trunks',
key: 'inbound',
data: dataLimits.data.inbound_trunks || 0,
callback: args.callback
},
argsMenuOutbound = {
module: 'trunks',
key: 'outbound',
data: dataLimits.data.outbound_trunks || 0,
callback: args.callback
},
argsMenuTwoway = {
module: 'trunks',
key: 'twoway',
data: dataLimits.data.twoway_trunks || 0,
callback: args.callback
};

monster.pub('myaccount.updateMenu', argsMenuInbound);
monster.pub('myaccount.updateMenu', argsMenuOutbound);
monster.pub('myaccount.updateMenu', argsMenuTwoway);
});
}
// We can't do the except logic for trunks, because we need to update the 2 other tabs anyway, and they're all using the same API
self.trunksGetLimits(function(dataLimits) {
var argsMenuInbound = {
module: 'trunks',
key: 'inbound',
data: dataLimits.data.inbound_trunks || 0,
callback: args.callback
},
argsMenuOutbound = {
module: 'trunks',
key: 'outbound',
data: dataLimits.data.outbound_trunks || 0,
callback: args.callback
},
argsMenuTwoway = {
module: 'trunks',
key: 'twoway',
data: dataLimits.data.twoway_trunks || 0,
callback: args.callback
};

monster.pub('myaccount.updateMenu', argsMenuInbound);
monster.pub('myaccount.updateMenu', argsMenuOutbound);
monster.pub('myaccount.updateMenu', argsMenuTwoway);
});
},

trunksRenderInbound: function(callback) {
Expand Down

0 comments on commit b74376c

Please sign in to comment.