fixes bug to show the amount of unread connections next to the chats tab
@@ -26,14 +26,14 @@ function genComponentConf() {
<li ng-class="{'mtb__tabs__selected' : self.selection == 0}"
class="clickable">
<a ng-click="self.router__stateGoResetParams('feed')"
- ng-class="{'disabled' : !self.hasPosts}">
+ ng-class="{'disabled' : !self.hasNeeds}">
Feed
</a>
</li>
<li ng-class="{'mtb__tabs__selected' : self.selection == 1}"
class="clickable">
<a ng-click="self.router__stateGoResetParams('overviewPosts')"
- ng-class="{'disabled' : !self.hasPosts}"
+ ng-class="{'disabled' : !self.hasNeeds}"
class="clickable">
Posts
<span class="mtb__tabs__unread">{{ self.nrOfUnreadNeeds }}</span>
@@ -74,10 +74,10 @@ function genComponentConf() {
const nrOfUnreadNeeds = ownNeeds && ownNeeds.filter(need => need.get("unread")).size;
const nonClosedConnections = allConnections && allConnections.filter(conn => conn.get("state") !== won.WON.Closed);
- const nrOfUnreadConnections = nonClosedConnections && nonClosedConnections.filter(conn => conn.get("unread"));
+ const nrOfUnreadConnections = nonClosedConnections && nonClosedConnections.filter(conn => conn.get("unread")).size;
return {
- hasPosts: ownNeeds && ownNeeds.size > 0,
+ hasNeeds: ownNeeds && ownNeeds.size > 0,
hasConnections: allConnections && allConnections.filter(conn => conn.get("state") !== won.WON.Closed).size > 0,
nrOfUnreadNeeds: nrOfUnreadNeeds > 0 ? nrOfUnreadNeeds : undefined,
nrOfUnreadConnections: nrOfUnreadConnections > 0 ? nrOfUnreadConnections : undefined,
