Files
kredits-web/app/routes/application.js
T
fsmanuel 99bbcda709 Move contributors + proposals to service
With this change we have all the contributors + proposals all the time in one place and can update them via events.
2018-04-15 19:02:57 +02:00

23 lines
557 B
JavaScript

import injectService from 'ember-service/inject';
import Route from 'ember-route';
export default Route.extend({
kredits: injectService(),
beforeModel(transition) {
const kredits = this.get('kredits');
return kredits.setup().then(() => {
if (kredits.get('accountNeedsUnlock')) {
if (confirm('It looks like you have an Ethereum wallet available. Please unlock your account.')) {
transition.retry();
}
}
});
},
afterModel() {
return this.get('kredits').loadContributorsAndProposals();
}
});