2018-01-11 01:57:43 +03:00
|
|
|
/* eslint-disable ghost/ember/alias-model-in-controller */
|
2019-05-06 16:51:23 +03:00
|
|
|
import Controller from '@ember/controller';
|
2017-08-22 10:53:26 +03:00
|
|
|
import {computed} from '@ember/object';
|
|
|
|
import {match} from '@ember/object/computed';
|
2017-10-30 12:38:01 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2015-05-26 05:10:50 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
export default Controller.extend({
|
2017-10-30 12:38:01 +03:00
|
|
|
ghostPaths: service(),
|
2019-05-06 16:51:23 +03:00
|
|
|
router: service(),
|
2014-06-25 16:12:48 +04:00
|
|
|
|
2019-05-06 16:51:23 +03:00
|
|
|
showBackLink: match('router.currentRouteName', /^setup\.(two|three)$/),
|
2015-10-28 14:36:45 +03:00
|
|
|
|
2019-05-06 16:51:23 +03:00
|
|
|
backRoute: computed('router.currentRouteName', function () {
|
|
|
|
let currentRoute = this.router.currentRouteName;
|
2014-06-25 16:12:48 +04:00
|
|
|
|
2015-07-16 17:12:03 +03:00
|
|
|
return currentRoute === 'setup.two' ? 'setup.one' : 'setup.two';
|
|
|
|
})
|
2014-06-25 16:12:48 +04:00
|
|
|
});
|