Skip to content

Commit

Permalink
Rename DirectionRouter to MainRouter for clarity (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Aug 12, 2020
1 parent 987905c commit f527a3a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions frontend/src/aspects/readit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import feedbackView from '../global/feedback-view';
import uploadSourceForm from '../global/upload-source-form';
import categoryStyles from '../global/category-styles';
import user from '../global/user';
import directionRouter from '../global/direction-router';
import mainRouter from '../global/main-router';
import userFsm from '../global/user-fsm';
import { ensureSources } from '../global/sources';
import explorerView from '../global/explorer-view';
Expand All @@ -24,12 +24,12 @@ history.once('route', () => {
uploadSourceForm.setHeight(availableHeight);
});

directionRouter.on('route:arrive', () => {
mainRouter.on('route:arrive', () => {
userFsm.handle('arrive');
});
directionRouter.on('route:upload', () => userFsm.handle('upload'));
directionRouter.on('route:explore', () => userFsm.handle('explore'));
directionRouter.on('route:leave', () => userFsm.handle('leave'));
mainRouter.on('route:upload', () => userFsm.handle('upload'));
mainRouter.on('route:explore', () => userFsm.handle('explore'));
mainRouter.on('route:leave', () => userFsm.handle('leave'));

userFsm.on('enter:arriving', () => welcomeView.render().$el.appendTo('#main'));
userFsm.on('exit:arriving', () => welcomeView.$el.detach());
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/aspects/registration.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import registrationForm from '../global/registration-view';
import confirmRegistrationView from '../global/confirm-registration-view';
import user from '../global/user';
import directionRouter from '../global/direction-router';
import mainRouter from '../global/main-router';
import authFsm from '../global/authentication-fsm';
import userFsm from '../global/user-fsm';

directionRouter.on('route:register', () => authFsm.handle('register'));
directionRouter.on('route:confirm-registration', (key) => {
mainRouter.on('route:register', () => authFsm.handle('register'));
mainRouter.on('route:confirm-registration', (key) => {
confirmRegistrationView.processKey(key);
userFsm.handle('confirm');
});
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/global/direction-router.ts

This file was deleted.

3 changes: 3 additions & 0 deletions frontend/src/global/main-router.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import MainRouter from '../navigation/main-router';

export default new MainRouter();
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { extend } from 'lodash';

import Router from '../core/router';

export default class DirectionRouter extends Router {}
export default class MainRouter extends Router {}

extend(DirectionRouter.prototype, {
extend(MainRouter.prototype, {
routes: {
'(arrive)': 'arrive',
'leave': 'leave',
Expand Down

0 comments on commit f527a3a

Please sign in to comment.