From 56469fc7ec4d608db43fc0f961133236e1b38599 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 11 Jan 2018 10:28:54 +0000 Subject: Uses `callDefault` --- app/assets/javascripts/dispatcher.js | 44 +++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index d0073a1a403..3b3d08d6724 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -440,10 +440,14 @@ import Activities from './activities'; break; case 'admin:groups:create': case 'admin:groups:new': - import('./pages/admin/groups/new').then(m => m.default()).catch(fail); + import('./pages/admin/groups/new') + .then(callDefault) + .catch(fail); break; case 'admin:groups:edit': - import('./pages/admin/groups/edit').then(m => m.default()).catch(fail); + import('./pages/admin/groups/edit') + .then(callDefault) + .catch(fail); break; case 'groups:edit': groupAvatar(); @@ -562,7 +566,9 @@ import Activities from './activities'; import('./pages/import/fogbugz/new_user_map').then(m => m.default()).catch(fail); break; case 'admin:impersonation_tokens:index': - import('./pages/admin/impersonation_tokens').then(m => m.default()).catch(fail); + import('./pages/admin/impersonation_tokens') + .then(callDefault) + .catch(fail); break; case 'profiles:personal_access_tokens:index': new DueDateSelectors(); @@ -599,35 +605,51 @@ import Activities from './activities'; // needed in rspec gl.u2fAuthenticate = u2fAuthenticate; case 'admin': - import('./pages/admin').then(m => m.default()).catch(fail); + import('./pages/admin') + .then(callDefault) + .catch(fail); switch (path[1]) { case 'broadcast_messages': - import('./pages/admin/broadcast_messages').then(m => m.default()).catch(fail); + import('./pages/admin/broadcast_messages') + .then(callDefault) + .catch(fail); break; case 'cohorts': - import('./pages/admin/cohorts').then(m => m.default()).catch(fail); + import('./pages/admin/cohorts') + .then(callDefault) + .catch(fail); break; case 'groups': switch (path[2]) { case 'show': - import('./pages/admin/groups/show').then(m => m.default()).catch(fail); + import('./pages/admin/groups/show') + .then(callDefault) + .catch(fail); break; } break; case 'projects': - import('./pages/admin/projects').then(m => m.default()).catch(fail); + import('./pages/admin/projects') + .then(callDefault) + .catch(fail); break; case 'labels': switch (path[2]) { case 'new': - import('./pages/admin/labels/new').then(m => m.default()).catch(fail); + import('./pages/admin/labels/new') + .then(callDefault) + .catch(fail); break; case 'edit': - import('./pages/admin/labels/edit').then(m => m.default()).catch(fail); + import('./pages/admin/labels/edit') + .then(callDefault) + .catch(fail); break; } case 'abuse_reports': - import('./pages/admin/abuse_reports').then(m => m.default()).catch(fail); + import('./pages/admin/abuse_reports') + .then(callDefault) + .catch(fail); break; } break; -- cgit v1.2.1