Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
fixes #92 #106
Browse files Browse the repository at this point in the history
  • Loading branch information
sponnet committed Feb 9, 2017
1 parent b44c5ea commit 8bf30b9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
9 changes: 9 additions & 0 deletions src/ac-helpers.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@
});
},

translateEthErrors: function(err){
var e = err.toString();
if (err && err.toString().startsWith('Error: Insufficient gas')){
return('something went wrong, try again.');
}
return err;
},



});
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/ac-profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
mode="imgonly"
size="big"
></ac-avatar>
<input type="file" class="hidden" id="avatarupload" on-change="avatarChange"/>
<input type="file" accept="image/*" class="hidden" id="avatarupload" on-change="avatarChange"/>
<paper-icon-button icon="sc-icons:upload" class="blueback white uploadicon" id="uploadbtn"></paper-icon-button>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/ac-swtconversion.html
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ <h1 class="bold centertxt yellow bigh">{{formatpong(swtbalance)}}</h1>
this.secondstate = 'doing';
this.convertTokens(function(err) {
if (err) {
this.secondstateerrormsg = err;
this.secondstateerrormsg = this.$.helpers.translateEthErrors(err);
this.convertingstarted = false;
return this.secondstate = 'error';
}
this.secondstate = 'succes';
Expand Down
2 changes: 1 addition & 1 deletion src/ac-tokenreceive.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@

<div class="item totalwidth">
<p class="topmsg grey4 hairline">
Transaction failed {{receivecoinstateerror}}.</p>
{{receivecoinstateerror}}</p>
<template is="dom-if" if="{{phoneview}}">
<div class="minispace"></div>
</template>
Expand Down
4 changes: 2 additions & 2 deletions src/ac-tokensend.html
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,10 @@
console.log('tx in error...');
self.$.whisper.whisperpost(self.receiver.from, JSON.stringify({
'command': 'transfererror',
'error': err.toString()
'error': self.$.helpers.translateEthErrors(err)
}));
self.sendcoinstate = 'transfererror';
self.transfererrormessage = err;
self.transfererrormessage = self.$.helpers.translateEthErrors(err);

} else {

Expand Down
8 changes: 5 additions & 3 deletions src/ac-vault.html
Original file line number Diff line number Diff line change
Expand Up @@ -797,12 +797,13 @@ <h1 class="bold blue">Great!</h1>
if (!file) {
return;
}

this.walletfilename = file.name;

self.uploadingwallet = true;
var reader = new FileReader();
reader.onload = function(e) {
var contents = e.target.result;
reader.onload = function(readere) {
var contents = readere.target.result;
//self.readwallet = contents;
//window.setTimeout(function(){
self.uploadingwallet = false;
Expand All @@ -811,7 +812,8 @@ <h1 class="bold blue">Great!</h1>
self.uploadingwallet = false;
self.pkshowpassw = true;
self.status = 'locked';
// self.fire('ready');
// reset file
e.target.value = null;
self.set('route.path', '/uploadunlock');
}
//},100);
Expand Down

0 comments on commit 8bf30b9

Please sign in to comment.