Block in application route if accountNeedsUnlock

The index route never gets invoked if you reload on the proposal page. That change makes sure we always initialize `ethProvider`.
This commit was merged in pull request #35.
This commit is contained in:
2018-04-08 00:31:07 +02:00
committed by Michael Bumann
parent 206c657b98
commit d8951caddb
2 changed files with 16 additions and 13 deletions
-11
View File
@@ -4,17 +4,6 @@ export default Ember.Route.extend({
kredits: Ember.inject.service(),
beforeModel(transition) {
const kredits = this.get('kredits');
return kredits.initEthProvider().then(() => {
if (kredits.get('accountNeedsUnlock')) {
if (confirm('It looks like you have an Ethereum wallet available. Please unlock your account.')) {
transition.retry();
}
}
});
},
model() {
let newContributor = Ember.getOwner(this).lookup('model:contributor');
newContributor.set('kind', 'person');