From d8951caddb3dd074340ec8c29a239e90d0d3c303 Mon Sep 17 00:00:00 2001 From: Manuel Wiedenmann Date: Sun, 8 Apr 2018 00:31:07 +0200 Subject: [PATCH 1/2] 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`. --- app/routes/application.js | 18 ++++++++++++++++-- app/routes/index.js | 11 ----------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/routes/application.js b/app/routes/application.js index 26d9f31..764b2eb 100644 --- a/app/routes/application.js +++ b/app/routes/application.js @@ -1,4 +1,18 @@ -import Ember from 'ember'; +import injectService from 'ember-service/inject'; +import Route from 'ember-route'; -export default Ember.Route.extend({ +export default Route.extend({ + kredits: injectService(), + + 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(); + } + } + }); + }, }); diff --git a/app/routes/index.js b/app/routes/index.js index 57a9228..d032132 100644 --- a/app/routes/index.js +++ b/app/routes/index.js @@ -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'); -- 2.50.1 From 21f187cac21937125df8e767fbde701d729ceb43 Mon Sep 17 00:00:00 2001 From: Manuel Wiedenmann Date: Sun, 8 Apr 2018 00:44:25 +0200 Subject: [PATCH 2/2] Replace missed profileHash with ipfsHash --- app/components/contributor-list/template.hbs | 4 ++-- app/models/contributor.js | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/components/contributor-list/template.hbs b/app/components/contributor-list/template.hbs index a9fa6dc..93feeb3 100644 --- a/app/components/contributor-list/template.hbs +++ b/app/components/contributor-list/template.hbs @@ -14,8 +14,8 @@ {{#if contributor.showMetadata}} diff --git a/app/models/contributor.js b/app/models/contributor.js index cd793d3..1c3801a 100644 --- a/app/models/contributor.js +++ b/app/models/contributor.js @@ -2,17 +2,24 @@ import computed from 'ember-computed'; import EmberObject from 'ember-object'; export default EmberObject.extend({ + // Contract id: null, + // TODO: Should we rename it to account like in the contract? address: null, - name: null, + balance: 0, + isCore: false, + ipfsHash: null, + + // IPFS kind: null, + name: null, url: null, github_username: null, github_uid: null, wiki_username: null, - profileHash: null, - balance: 0, - isCore: false, + ipfsData: '', + + // Deprecated isCurrentUser: false, avatarURL: computed('github_uid', function() { -- 2.50.1