Browse Source

receive zaddr render fix, z_exportkey

v0.25
pbca26 7 years ago
parent
commit
fae70f37aa
  1. 6
      react/src/actions/actions/settings.js
  2. 10
      react/src/components/dashboard/receiveCoin/receiveCoin.js
  3. 8
      react/src/components/dashboard/receiveCoin/receiveCoin.render.js

6
react/src/actions/actions/settings.js

@ -3,7 +3,7 @@ import {
GET_WIF_KEY,
GET_DEBUG_LOG,
GET_PEERS_LIST,
LOAD_APP_CONFIG
LOAD_APP_CONFIG,
} from '../storeType';
import { translate } from '../../translate/translate';
import { triggerToaster } from '../actionCreators';
@ -442,12 +442,12 @@ export function getWalletDatKeys(chain, keyMatchPattern) {
});
}
export function dumpPrivKey(coin, address) {
export function dumpPrivKey(coin, address, isZaddr) {
return new Promise((resolve, reject) => {
const payload = {
mode: null,
chain: coin,
cmd: 'dumpprivkey',
cmd: isZaddr ? 'z_exportkey' : 'dumpprivkey',
params: [ address ]
};

10
react/src/components/dashboard/receiveCoin/receiveCoin.js

@ -60,9 +60,9 @@ class ReceiveCoin extends React.Component {
);
}
dumpPrivKey(address) {
dumpPrivKey(address, isZaddr) {
this.toggleAddressMenu(address);
dumpPrivKey(this.props.coin, address)
dumpPrivKey(this.props.coin, address, isZaddr)
.then((json) => {
if (json.length &&
json.length > 10) {
@ -157,7 +157,8 @@ class ReceiveCoin extends React.Component {
}
if (!this.state.toggleIsMine &&
!address.canspend) {
!address.canspend &&
address.address.substring(0, 2) !== 'zc') {
items.pop();
}
} else {
@ -166,7 +167,8 @@ class ReceiveCoin extends React.Component {
);
if (!this.state.toggleIsMine &&
!address.canspend) {
!address.canspend &&
address.address.substring(0, 2) !== 'zc') {
items.pop();
}
}

8
react/src/components/dashboard/receiveCoin/receiveCoin.render.js

@ -3,6 +3,8 @@ import { translate } from '../../../translate/translate';
import QRModal from '../qrModal/qrModal';
import InvoiceModal from '../invoiceModal/invoiceModal';
// TODO: zaddr match length > 64 chars
export const AddressActionsNonBasiliskModeRender = function(address, type) {
return (
<td>
@ -25,7 +27,7 @@ export const AddressActionsNonBasiliskModeRender = function(address, type) {
<i className="icon wb-copy margin-right-5"></i> { translate('INDEX.COPY') + ' pub key' }
</li>
{ !address.canspend &&
<li onClick={ () => this.dumpPrivKey(address) }>
<li onClick={ () => this.dumpPrivKey(address, type !== 'public' ? true : null) }>
<i className="icon fa-key margin-right-5"></i> { translate('INDEX.COPY') + ' priv key (WIF)' }
</li>
}
@ -43,9 +45,10 @@ export const AddressItemRender = function(address, type) {
return (
<tr key={ address.address }>
{ this.renderAddressActions(address.address, type) }
<td>
<td title={ type !== 'public' ? address.address : '' }>
{ type === 'public' ? address.address : `${address.address.substring(0, 34)}...` }
{ !address.canspend &&
address.address.substring(0, 2) !== 'zc' &&
<i
title="You don't own priv keys for this address"
className="fa fa-ban margin-left-10"></i>
@ -54,6 +57,7 @@ export const AddressItemRender = function(address, type) {
<td>
<span>{ address.amount }</span>
{ !address.canspend &&
address.address.substring(0, 2) !== 'zc' &&
<span title="Available amount to spend: 0"> (0)</span>
}
</td>

Loading…
Cancel
Save