Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

Commit

Permalink
#48 don't enforce using memo, but only show a warning. When a known a…
Browse files Browse the repository at this point in the history
…ccount is entered the memo field is shown and a warning is displayed that the destination requires a memo. Users can opt out of using a memo by clicking 'cancel'.
  • Loading branch information
lenondupe committed Dec 19, 2017
1 parent cf4e8d5 commit 71ede16
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
20 changes: 7 additions & 13 deletions controllers/send-widget.controller.es6
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,14 @@ export default class SendWidgetController {
this.memoBlocked = false;
}

if (this.destination in knownAccounts && knownAccounts[this.destination].memo_required) {
if (this.destination in knownAccounts && knownAccounts[this.destination].requiredMemoType) {
this.memo = true;
this.memoType = knownAccounts[this.destination].requiredMemoType;
let alert = new Alert({
text: 'The payment destination (' + knownAccounts[this.destination].name +') requires you to specify a memo to identify your account.',
type: Alert.TYPES.WARNING
});
this.memoAlertGroup.show(alert);
}

this.loadingDestination = false;
Expand Down Expand Up @@ -209,18 +215,6 @@ export default class SendWidgetController {
this.amountAlertGroup.show(alert);
}

// check if the destination requires a memo
if (this.destination in knownAccounts && knownAccounts[this.destination].memo_required && !this.memoValue) {
let alert = new Alert({
title: '',
text: 'The payment destination (' + knownAccounts[this.destination].name +') requires you to specify a memo to identify your account.',
type: Alert.TYPES.ERROR
});
this.memoAlertGroup.show(alert);
this.sending = false;
return;
}

if (this.memo) {
let memo, memoError;
try {
Expand Down
12 changes: 6 additions & 6 deletions known_accounts.es6
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
const knownAccounts = {
'GCGNWKCJ3KHRLPM3TM6N7D3W5YKDJFL6A2YCXFXNMRTZ4Q66MEMZ6FI2': {
name: 'Poloniex',
memo_required: true
requiredMemoType: 'MEMO_ID'
},
'GA5XIGA5C7QTPTWXQHY6MCJRMTRZDOSHR6EFIBNDQTCQHG262N4GGKTM': {
name: 'Kraken',
memo_required: true
requiredMemoType: 'MEMO_ID'
},
'GB6YPGW5JFMMP2QB2USQ33EUWTXVL4ZT5ITUNCY3YKVWOJPP57CANOF3': {
name: 'Bittrex',
memo_required: true
requiredMemoType: 'MEMO_TEXT'
},
'GB7GRJ5DTE3AA2TCVHQS2LAD3D7NFG7YLTOEWEBVRNUUI2Q3TJ5UQIFM': {
name: 'BTC38',
memo_required: true
requiredMemoType: 'MEMO_ID'
},
'GBV4ZDEPNQ2FKSPKGJP2YKDAIZWQ2XKRQD4V4ACH3TCTFY6KPY3OAVS7': {
name: 'Changelly',
memo_required: true
requiredMemoType: 'MEMO_ID'
},
'GC4KAS6W2YCGJGLP633A6F6AKTCV4WSLMTMIQRSEQE5QRRVKSX7THV6S': {
name: 'BitcoinIndonesia',
memo_required: true
requiredMemoType: 'MEMO_TEXT'
}
};
export default knownAccounts;

0 comments on commit 71ede16

Please sign in to comment.