Skip to content

Commit 675f26a

Browse files
authored
Merge pull request #38 from GetScatter/master
fio fixes
2 parents b812c49 + cb5a3ba commit 675f26a

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bridge",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"private": true,
55
"scripts": {
66
"build": "npm run check && yarn && cross-env NODE_ENV=production BABEL_ENV=prod vue-cli-service build && npm run zip",

src/components/popups/Transfer.vue

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import PasswordHelpers from "../../services/utility/PasswordHelpers";
4747
import RecipientField from '../reusable/RecipientField';
4848
import BalanceHelpers from "../../services/utility/BalanceHelpers";
49+
import SingularAccounts from "../../services/utility/SingularAccounts";
4950
5051
const STATES = {
5152
TEXT:'text',
@@ -114,6 +115,9 @@
114115
},
115116
hasMemo(){
116117
return this.token.blockchain === Blockchains.EOSIO;
118+
},
119+
fioAccount(){
120+
return this.scatter.keychain.accounts.find(x => x.network().blockchain === Blockchains.FIO);
117121
}
118122
},
119123
methods:{
@@ -140,7 +144,7 @@
140144
141145
let recipient = this.contact ? this.contact.recipient : this.recipient;
142146
143-
if(recipient.indexOf('@') > -1){
147+
if(this.fioAccount && recipient.indexOf('@') > -1){
144148
// FIO name
145149
const fioPlugin = PluginRepository.plugin(Blockchains.FIO);
146150
if(!fioPlugin.isValidRecipient(recipient))
@@ -152,12 +156,16 @@
152156
153157
if (!this.featureFlags.fioResolutions) return PopupService.push(Popups.snackbar("FIO resolutions are currently disabled, please use an address directly."));
154158
155-
const fioRecipient = await fioPlugin.recipientToSendable(this.token.network(), recipient, this.token.blockchain, this.token.symbol, address => {
156-
if (address === 0) return null;
157-
// Maybe some wallets do `account@permission`, just in case
158-
if (address.indexOf('@')) return address.split('@')[0];
159-
return address;
160-
}).catch(() => null);
159+
const getFioRecipient = (symbol) => {
160+
return fioPlugin.recipientToSendable(this.fioAccount.network(), recipient, this.token.blockchain, symbol, address => {
161+
if (address === 0) return null;
162+
// Maybe some wallets do `account@permission`, just in case
163+
if (address.indexOf('@')) return address.split('@')[0];
164+
return address;
165+
}).catch(() => null)
166+
}
167+
168+
const fioRecipient = (await getFioRecipient(this.token.symbol) || await getFioRecipient(this.token.network().systemToken().symbol));
161169
162170
if (!fioRecipient) return PopupService.push(Popups.snackbar(`The identity you entered does not exist, or does not accept these tokens.`));
163171
recipient = fioRecipient;

src/components/popups/fio/RequestFioTokens.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
reset(null);
101101
this.closer(true);
102102
} else {
103-
reset(requested.error ? requested.error : "There was an error creating this request.");
103+
reset(requested && requested.error ? requested.error : "There was an error creating this request.");
104104
}
105105
},
106106
},

0 commit comments

Comments
 (0)