added number of unread connections to the overview title bar (main navigation bar)
@@ -44,7 +44,7 @@ function genComponentConf() {
<a ng-click="self.router__stateGoResetParams('overviewIncomingRequests')"
ng-class="{'disabled' : !self.hasConnections}">
Chats
- <span class="mtb__tabs__unread"></span>
+ <span class="mtb__tabs__unread"> {{ self.nrOfUnreadConnections }}</span>
</a>
</li>
</ul>
@@ -73,10 +73,14 @@ 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"));
+
return {
hasPosts: 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,
};
};
