From ad76fb2369cb7753ed94eff218f5cb40562daaf9 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Wed, 8 Feb 2017 13:58:36 +0800 Subject: [PATCH] Warn non-Ethereum users when trying to add contributor --- app/components/add-contributor/component.js | 12 ++++++++++-- app/templates/index.hbs | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/components/add-contributor/component.js b/app/components/add-contributor/component.js index 1df01dc..29165b5 100644 --- a/app/components/add-contributor/component.js +++ b/app/components/add-contributor/component.js @@ -39,9 +39,16 @@ export default Ember.Component.extend({ }, actions: { + save() { - if(this.get('isValid')) { + if (!this.get('contractInteractionEnabled')) { + alert('Only core team members can add new contributors. Please ask someone to set you up.'); + return; + } + + if (this.get('isValid')) { this.set('inProgress', true); + this.get('kredits').addContributor( this.get('address'), this.get('realName'), @@ -54,9 +61,10 @@ export default Ember.Component.extend({ window.scroll(0,0); }); } else { - alert('invalid data. please review'); + alert('Invalid data. Please review and try again.'); } } + } }); diff --git a/app/templates/index.hbs b/app/templates/index.hbs index 5ce1c70..b4e0bb6 100644 --- a/app/templates/index.hbs +++ b/app/templates/index.hbs @@ -42,6 +42,8 @@
- {{add-contributor kredits=kredits contributors=model.contributors}} + {{add-contributor kredits=kredits + contributors=model.contributors + contractInteractionEnabled=contractInteractionEnabled}}