Skip to content

Commit

Permalink
Optimize line length in the readit aspect module (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Jul 2, 2020
1 parent f690393 commit 8a91316
Showing 1 changed file with 19 additions and 28 deletions.
47 changes: 19 additions & 28 deletions frontend/src/aspects/readit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ history.once('route', () => {
uploadSourceForm.setHeight(availableHeight);
});

directionRouter.on('route:register', () => {
userFsm.handle('register');
});
directionRouter.on('route:register', () => userFsm.handle('register'));
directionRouter.on('route:confirm-registration', (key) => {
confirmRegistrationView.processKey(key);
directionFsm.handle('confirm');
Expand All @@ -38,29 +36,17 @@ directionRouter.on('route:arrive', () => {
directionFsm.handle('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');
});
directionRouter.on('route:upload', () => userFsm.handle('upload'));
directionRouter.on('route:explore', () => userFsm.handle('explore'));
directionRouter.on('route:leave', () => userFsm.handle('leave'));

directionFsm.on('enter:confirming', () => {
confirmRegistrationView.render().$el.appendTo('#main');
});
directionFsm.on('exit:confirming', () => {
confirmRegistrationView.$el.detach();
});
directionFsm.on('exit:confirming', () => confirmRegistrationView.$el.detach());

userFsm.on('enter:arriving', () => {
welcomeView.render().$el.appendTo('#main');
});
userFsm.on('exit:arriving', () => {
welcomeView.$el.detach();
});
userFsm.on('enter:arriving', () => welcomeView.render().$el.appendTo('#main'));
userFsm.on('exit:arriving', () => welcomeView.$el.detach());
userFsm.on('enter:uploading', () => {
uploadSourceForm.render().$el.appendTo('#main');
});
Expand All @@ -73,13 +59,18 @@ userFsm.on('enter:exploring', () => {
welcomeView.$el.detach();
explorerView.$el.appendTo('#main');
});
userFsm.on('exit:exploring', () => {
if (explorerView) explorerView.$el.detach();
});
userFsm.on('exit:exploring', () => explorerView.$el.detach());

menuView.on('feedback', () => feedbackView.render().$el.appendTo('body'));

menuView.on('feedback', () => { feedbackView.render().$el.appendTo('body'); });
feedbackView.on('close', () => feedbackView.$el.detach());

user.on('confirm-registration:success', () => confirmRegistrationView.success());
user.on('confirm-registration:notfound', () => confirmRegistrationView.notFound());
user.on('confirm-registration:error', (response) => confirmRegistrationView.error(response));
user.on('confirm-registration:success', () => {
confirmRegistrationView.success()
});
user.on('confirm-registration:notfound', () => {
confirmRegistrationView.notFound()
});
user.on('confirm-registration:error', (response) => {
confirmRegistrationView.error(response)
});

0 comments on commit 8a91316

Please sign in to comment.