diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index 4e9f40b..aec2071 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -1270,7 +1270,7 @@ export function fetchUtxoCache(_payload) { _route = _payload.allcoins ? 'cache-all' : 'cache-one', _coin = '&coin=' + _payload.coin, _calls = '&calls=' + _payload.calls, - _address = '&address' + _payload.address, + _address = '&address=' + _payload.address, _iguanaInstancePort = Config.useBasiliskInstance ? '&port=' + Config.basiliskPort : ''; return dispatch => { @@ -1829,6 +1829,13 @@ function sendToAddressState(json, dispatch) { } } +export function sendToAddressStateAlt(json) { + return { + type: DASHBOARD_ACTIVE_COIN_SENDTO, + lastSendToResponse: json, + } +} + export function clearLastSendToResponseState() { return { type: DASHBOARD_ACTIVE_COIN_SENDTO, diff --git a/react/src/components/dashboard/loginModal.js b/react/src/components/dashboard/loginModal.js new file mode 100644 index 0000000..0ea5629 --- /dev/null +++ b/react/src/components/dashboard/loginModal.js @@ -0,0 +1,95 @@ +import React from 'react'; +import { translate } from '../../translate/translate'; +import { + toggleAddcoinModal, + iguanaWalletPassphrase, + iguanaActiveHandle +} from '../../actions/actionCreators'; +import Store from '../../store'; + +class LoginModal extends React.Component { + constructor(props) { + super(props); + this.state = { + display: false, + activeLoginSection: 'activateCoin', + loginPassphrase: null, + seedInputVisibility: false, + }; + /*this.toggleActivateCoinForm = this.toggleActivateCoinForm.bind(this); + this.updateInput = this.updateInput.bind(this); + this.loginSeed = this.loginSeed.bind(this); + this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this); + this.handleRegisterWallet = this.handleRegisterWallet.bind(this);*/ + } + + toggleSeedInputVisibility() { + this.setState({ + seedInputVisibility: !this.state.seedInputVisibility, + }); + } + + toggleActivateCoinForm() { + Store.dispatch(toggleAddcoinModal(true, false)); + } + + updateInput(e) { + this.setState({ + [e.target.name]: e.target.value, + isSeedConfirmError: false, + }); + } + + loginSeed() { + Store.dispatch(iguanaWalletPassphrase(this.state.loginPassphrase)); + } + + render() { + if (this.props.Dashboard.activateLoginModal) { + return ( +
+ +
+ ); + } else { + return null; + } + } +} + +export default LoginModal; diff --git a/react/src/components/dashboard/sendCoin.js b/react/src/components/dashboard/sendCoin.js index 4ac7138..24e5043 100644 --- a/react/src/components/dashboard/sendCoin.js +++ b/react/src/components/dashboard/sendCoin.js @@ -9,7 +9,8 @@ import { resolveOpenAliasAddress, triggerToaster, iguanaUTXORawTX, - clearLastSendToResponseState + clearLastSendToResponseState, + sendToAddressStateAlt } from '../../actions/actionCreators'; import Store from '../../store'; @@ -139,7 +140,7 @@ class SendCoin extends React.Component { if (step === 2) { if (!this.state.sendApiType && this.props.ActiveCoin.mode === 'basilisk') { - handleBasiliskSend(); + this.handleBasiliskSend(); } else { Store.dispatch(sendToAddress(this.props.ActiveCoin.coin, this.state)); } @@ -166,7 +167,9 @@ class SendCoin extends React.Component { } handleBasiliskSend() { - const utxoSet = this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.state.sendFrom].refresh; + const refreshData = this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.state.sendFrom].refresh; + const listunspentData = this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.state.sendFrom].listunspent; + const utxoSet = refreshData && refreshData.data || listunspentData && listunspentData.data; const sendData = { 'coin': this.props.ActiveCoin.coin, 'sendfrom': this.state.sendFrom, @@ -181,15 +184,20 @@ class SendCoin extends React.Component { console.log('sendData', sendData); console.log('iguanaUTXORawTXJSON', json); if (json.result === 'success' && json.completed === true) { - Store.dispatch(triggerToaster(true, translate('TOASTR.SIGNED_TX_GENERATED') + '.', translate('TOASTR.WALLET_NOTIFICATION'))); + Store.dispatch(triggerToaster(true, translate('TOASTR.SIGNED_TX_GENERATED') + '.', translate('TOASTR.WALLET_NOTIFICATION'), 'success')); + Store.dispatch(sendToAddressStateAlt(json)); if (sendData.sendsig === 1) { - Store.dispatch(triggerToaster(true, translate('TOASTR.SENDING_TX') + '.', translate('TOASTR.WALLET_NOTIFICATION'))); - ajax_data_dexrawtx = { + //Store.dispatch(triggerToaster(true, translate('TOASTR.SENDING_TX') + '.', translate('TOASTR.WALLET_NOTIFICATION'), 'success')); + /*ajax_data_dexrawtx = { 'signedtx': json.signedtx, 'coin': sendData.coin - }; + };*/ + } else { + Store.dispatch(sendToAddressStateAlt(json)); } + } else { + Store.dispatch(triggerToaster(true, translate('TOASTR.SIGNED_TX_GENERATED_FAIL') + '.', translate('TOASTR.WALLET_NOTIFICATION'), 'error')); } console.log(json); }); diff --git a/react/src/config.js b/react/src/config.js index ec47c42..e8ea9dd 100644 --- a/react/src/config.js +++ b/react/src/config.js @@ -4,6 +4,7 @@ module.exports = { agamaPort: 17777, enableCacheApi: true, useBasiliskInstance: true, - openAlias: true, + useForksAll: true, + openAlias: false, debug: true, };