Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix triggers loading bug #173

Merged
merged 3 commits into from
Jun 22, 2015
Merged

Fix triggers loading bug #173

merged 3 commits into from
Jun 22, 2015

Conversation

kelbongoo
Copy link
Contributor

This fixes a bug where multiple global enter/exit triggers are overwritten and not concatenated.
Eg if I do

FlowRouter.triggers.enter([fooTrigger]);
FlowRouter.triggers.enter([barTrigger]);

only barTrigger will show up in FlowRouter._triggersEnter array

@@ -452,15 +452,15 @@ Router.prototype._initTriggersAPI = function() {
this.triggers = {
enter: function(triggers, filter) {
triggers = Triggers.applyFilters(triggers, filter);
_.extend(self._triggersEnter, triggers);
if(triggers.length) self._triggersEnter = self._triggersEnter.concat(triggers);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arunoda
Copy link
Contributor

arunoda commented Jun 21, 2015

Thanks. This is a lame mistake of me.

arunoda added a commit that referenced this pull request Jun 22, 2015
@arunoda arunoda merged commit fc45803 into kadirahq:master Jun 22, 2015
@arunoda
Copy link
Contributor

arunoda commented Jun 22, 2015

Great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants