2019-04-17 23:17:48 +00:00
|
|
|
import Route from '@ember/routing/route';
|
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
export default class IndexRoute extends Route {
|
2019-04-17 23:17:48 +00:00
|
|
|
setupController(controller, model) {
|
|
|
|
// Suppress the preemptedByAllocation fetch error in the event it's a 404
|
2019-04-22 23:10:21 +00:00
|
|
|
if (model) {
|
|
|
|
const setPreempter = () => controller.set('preempter', model.preemptedByAllocation);
|
|
|
|
model.preemptedByAllocation.then(setPreempter, setPreempter);
|
|
|
|
}
|
2019-04-17 23:17:48 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
return super.setupController(...arguments);
|
|
|
|
}
|
2019-05-20 22:35:21 +00:00
|
|
|
|
|
|
|
resetController(controller, isExiting) {
|
|
|
|
if (isExiting) {
|
|
|
|
controller.watchNext.cancelAll();
|
|
|
|
}
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
|
|
|
}
|