diff options
Diffstat (limited to 'client/config/router.js')
-rw-r--r-- | client/config/router.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/client/config/router.js b/client/config/router.js index a3d8897d..77b17b63 100644 --- a/client/config/router.js +++ b/client/config/router.js @@ -7,12 +7,12 @@ FlowRouter.route('/', { name: 'home', triggersEnter: [AccountsTemplates.ensureSignedIn], action: function() { - EscapeActions.executeAll(); - Filter.reset(); - Session.set('currentBoard', null); Session.set('currentCard', null); + Filter.reset(); + EscapeActions.executeAll(); + BlazeLayout.render('defaultLayout', { content: 'boardList' }); } }); @@ -21,15 +21,16 @@ FlowRouter.route('/b/:id/:slug', { name: 'board', action: function(params) { let currentBoard = params.id; + let previousBoard = Session.get('currentBoard'); + Session.set('currentBoard', currentBoard); + Session.set('currentCard', null); + // If we close a card, we'll execute again this route action but we don't // want to excape every current actions (filters, etc.) - if (Session.get('currentBoard') !== currentBoard) { + if (previousBoard !== currentBoard) { EscapeActions.executeAll(); } - Session.set('currentBoard', currentBoard); - Session.set('currentCard', null); - BlazeLayout.render('defaultLayout', { content: 'board' }); } }); @@ -37,10 +38,11 @@ FlowRouter.route('/b/:id/:slug', { FlowRouter.route('/b/:boardId/:slug/:cardId', { name: 'card', action: function(params) { - EscapeActions.executeUpTo('inlinedForm'); Session.set('currentBoard', params.boardId); Session.set('currentCard', params.cardId); + EscapeActions.executeUpTo('inlinedForm'); + BlazeLayout.render('defaultLayout', { content: 'board' }); } }); |