Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/filterStorage.js

Issue 29339666: Issue 3915 - Dispatch filters.added consistently (Closed)
Patch Set: Created April 13, 2016, 7:44 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterStorage.js
diff --git a/lib/filterStorage.js b/lib/filterStorage.js
index 9ea35f53365c03fc052c1bf43070f5c7aa54f3f2..3429b5154082435fc64a7eca01a99c0264c9ab50 100644
--- a/lib/filterStorage.js
+++ b/lib/filterStorage.js
@@ -232,20 +232,22 @@ let FilterStorage = exports.FilterStorage =
return; // No need to add
subscription = FilterStorage.getGroupForFilter(filter);
}
+
if (!subscription)
{
// No group for this filter exists, create one
subscription = SpecialSubscription.createForFilter(filter);
this.addSubscription(subscription);
- return;
}
+ else
+ {
+ if (typeof position == "undefined")
+ position = subscription.filters.length;
- if (typeof position == "undefined")
- position = subscription.filters.length;
-
- if (filter.subscriptions.indexOf(subscription) < 0)
- filter.subscriptions.push(subscription);
- subscription.filters.splice(position, 0, filter);
+ if (filter.subscriptions.indexOf(subscription) < 0)
+ filter.subscriptions.push(subscription);
+ subscription.filters.splice(position, 0, filter);
+ }
if (!silent)
FilterNotifier.triggerListeners("filter.added", filter, subscription, position);
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld