don't use stack to dedup notifications

This commit is contained in:
Spencer Alger 2014-09-16 10:51:00 -07:00
parent 2488a758a1
commit 61c9331932
2 changed files with 6 additions and 7 deletions

View file

@ -55,20 +55,19 @@ define(function (require) {
});
}
if (!notif.count) notif.count = 1;
notif.count = (notif.count || 0) + 1;
var dup = _.find(notifs, function (item) {
return item.content === notif.content
&& item.stack === notif.stack
&& item.lifetime === notif.lifetime;
return item.content === notif.content && item.lifetime === notif.lifetime;
});
if (dup) {
dup.count++;
dup.count += 1;
dup.stacks = _.union(dup.stacks, [notif.stack]);
} else {
notif.stacks = [notif.stack];
notifs.push(notif);
}
}
function formatMsg(msg, from) {

View file

@ -34,7 +34,7 @@
</div>
<div ng-if="notif.stack && notif.showStack" class="toast-stack alert" ng-class="'alert-' + notif.type">
<pre ng-bind="notif.stack"></pre>
<pre ng-repeat="stack in notif.stacks" ng-bind="stack"></pre>
</div>
</li>