Browse Source

native send not fully synced warning

v0.25
pbca26 7 years ago
parent
commit
bb364196e3
  1. 2
      react/src/actions/actions/nativeSyncInfo.js
  2. 14
      react/src/components/dashboard/sendCoin/sendCoin.js
  3. 5
      react/src/components/dashboard/sendCoin/sendCoin.render.js

2
react/src/actions/actions/nativeSyncInfo.js

@ -15,7 +15,7 @@ export function nativeGetinfoFailureState() {
}
}
// TODO: use debug.log instead
// TODO: use blockchaininfo rpc
export function getSyncInfoNativeKMD(skipDebug, json, skipRemote) {
let _json = json;

14
react/src/components/dashboard/sendCoin/sendCoin.js

@ -22,7 +22,6 @@ import { isPositiveNumber } from '../../../util/number';
// TODO: - add links to explorers
// - render z address trim
// spv, request utxo and check if any failed to verify, display alert notice
class SendCoin extends React.Component {
constructor(props) {
@ -53,6 +52,7 @@ class SendCoin extends React.Component {
this.SendFormRender = _SendFormRender.bind(this);
this.isTransparentTx = this.isTransparentTx.bind(this);
this.toggleSubstractFee = this.toggleSubstractFee.bind(this);
this.isFullySynced = this.isFullySynced.bind(this);
}
SendFormRender() {
@ -554,6 +554,17 @@ class SendCoin extends React.Component {
return false;
}
isFullySynced() {
if (this.props.ActiveCoin.progress &&
this.props.ActiveCoin.progress.longestchain &&
this.props.ActiveCoin.progress.blocks &&
this.props.ActiveCoin.progress.longestchain > 0 &&
this.props.ActiveCoin.progress.blocks > 0 &&
Number(this.state.prevProgress.blocks) * 100 / Number(this.state.prevProgress.longestchain) === 100) {
return true;
}
}
render() {
if (this.props &&
this.props.ActiveCoin &&
@ -575,6 +586,7 @@ const mapStateToProps = (state, props) => {
balance: state.ActiveCoin.balance,
activeSection: state.ActiveCoin.activeSection,
lastSendToResponse: state.ActiveCoin.lastSendToResponse,
progress: state.ActiveCoin.progress,
},
Dashboard: state.Dashboard,
};

5
react/src/components/dashboard/sendCoin/sendCoin.render.js

@ -121,6 +121,11 @@ export const _SendFormRender = function() {
{ this.props.ActiveCoin.coin }
</span>
</div>
{ !this.isFullySynced() && this.props.ActiveCoin && this.props.ActiveCoin.mode === 'native' &&
<div className="col-lg-12 padding-top-20 padding-bottom-20 send-coin-sync-warning">
<i className="icon fa-warning color-warning margin-right-5"></i> <span className="desc">Your wallet is not fully synced! Please wait until it reached 100% to avoid possible transaction send implications.</span>
</div>
}
<div className="col-lg-12">
<button
type="button"

Loading…
Cancel
Save