Browse Source

claim interest not fully synced native coin warning sign

v0.25
pbca26 7 years ago
parent
commit
4dbba2076b
  1. 8
      react/src/actions/actionCreators.js
  2. 2
      react/src/actions/actions/nativeNewAddress.js
  3. 17
      react/src/components/dashboard/claimInterestModal/claimInterestModal.js
  4. 7
      react/src/components/dashboard/claimInterestModal/claimInterestModal.render.js
  5. 22
      react/src/components/dashboard/coinTile/coinTileItem.js
  6. 2
      react/src/components/dashboard/importKeyModal/importKeyModal.js
  7. 2
      react/src/components/dashboard/walletsBalance/walletsBalance.js
  8. 10
      react/src/reducers/activeCoin.js
  9. 2
      react/src/translate/en.js

8
react/src/actions/actionCreators.js

@ -176,17 +176,19 @@ export function dashboardChangeSection(sectionName) {
}
}
export function dashboardChangeActiveCoinState(coin, mode) {
export function dashboardChangeActiveCoinState(coin, mode, skipCoinsArrayUpdate) {
console.warn(skipCoinsArrayUpdate);
return {
type: DASHBOARD_ACTIVE_COIN_CHANGE,
coin: coin,
mode: mode,
skip: skipCoinsArrayUpdate,
}
}
export function dashboardChangeActiveCoin(coin, mode) {
export function dashboardChangeActiveCoin(coin, mode, skipCoinsArrayUpdate) {
return dispatch => {
dispatch(dashboardChangeActiveCoinState(coin, mode));
dispatch(dashboardChangeActiveCoinState(coin, mode, skipCoinsArrayUpdate));
}
}

2
react/src/actions/actions/nativeNewAddress.js

@ -1,7 +1,7 @@
import { translate } from '../../translate/translate';
import {
triggerToaster,
getDashboardUpdate
getDashboardUpdate,
} from '../actionCreators';
import Config from '../../config';

17
react/src/components/dashboard/claimInterestModal/claimInterestModal.js

@ -44,6 +44,7 @@ class ClaimInterestModal extends React.Component {
this.openDropMenu = this.openDropMenu.bind(this);
this.closeDropMenu = this.closeDropMenu.bind(this);
this.closeModal = this.closeModal.bind(this);
this.isFullySynced = this.isFullySynced.bind(this);
}
componentWillMount() {
@ -52,6 +53,17 @@ class ClaimInterestModal extends React.Component {
}
}
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.props.ActiveCoin.progress.blocks) * 100 / Number(this.props.ActiveCoin.progress.longestchain) === 100) {
return true;
}
}
openDropMenu() {
this.setState(Object.assign({}, this.state, {
addressSelectorOpen: !this.state.addressSelectorOpen,
@ -337,8 +349,8 @@ class ClaimInterestModal extends React.Component {
render() {
if (this.props.ActiveCoin &&
this.props.ActiveCoin.coin &&
this.props.ActiveCoin.coin === 'KMD') {
this.props.ActiveCoin.coin /*&&
this.props.ActiveCoin.coin === 'KMD'*/) {
return ClaimInterestModalRender.call(this);
} else {
return null;
@ -353,6 +365,7 @@ const mapStateToProps = (state) => {
coin: state.ActiveCoin.coin,
balance: state.ActiveCoin.balance,
activeSection: state.ActiveCoin.activeSection,
progress: state.ActiveCoin.progress,
},
Dashboard: {
displayClaimInterestModal: state.Dashboard.displayClaimInterestModal,

7
react/src/components/dashboard/claimInterestModal/claimInterestModal.render.js

@ -109,6 +109,13 @@ export const _ClaimInterestTableRender = function() {
{ this.addressDropdownRender() }
</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">{ translate('SEND.SEND_NATIVE_SYNC_WARNING') }</span>
</div>
}
</div>
}
<div className="table-scroll">

22
react/src/components/dashboard/coinTile/coinTileItem.js

@ -88,7 +88,7 @@ class CoinTileItem extends React.Component {
}
}
autoSetActiveCoin() {
autoSetActiveCoin(skipCoin) {
const modes = [
'native',
'spv',
@ -99,10 +99,11 @@ class CoinTileItem extends React.Component {
let _mode;
let _coin;
console.warn('allCoins', allCoins);
if (allCoins) {
modes.map((mode) => {
allCoins[mode].map((coin) => {
if (!_coinSelected) {
if (!_coinSelected && coin !== skipCoin) {
_coinSelected = true;
_coin = coin;
_mode = mode;
@ -111,17 +112,19 @@ class CoinTileItem extends React.Component {
});
if (_coinMode.KMD &&
_coinMode.KMD === 'native') {
_coinMode.KMD === 'native' &&
skipCoin !== 'KMD') {
_coin = 'KMD';
_mode = 'native';
} else if (_coinMode.KMD && _coinMode.KMD === 'spv') {
} else if (_coinMode.KMD && _coinMode.KMD === 'spv' && skipCoin !== 'KMD') {
_coin = 'KMD';
_mode = 'spv';
}
});
setTimeout(() => {
this._dashboardChangeActiveCoin(_coin, _mode);
console.warn('autoset active coin', _coin);
this._dashboardChangeActiveCoin(_coin, _mode, true);
}, 100);
}
}
@ -157,7 +160,7 @@ class CoinTileItem extends React.Component {
Store.dispatch(getDexCoins());
Store.dispatch(activeHandle());
setTimeout(() => {
this.autoSetActiveCoin();
this.autoSetActiveCoin(coin);
setTimeout(() => {
Store.dispatch(dashboardRemoveCoin(coin));
}, 500);
@ -189,7 +192,7 @@ class CoinTileItem extends React.Component {
Store.dispatch(getDexCoins());
Store.dispatch(activeHandle());
setTimeout(() => {
this.autoSetActiveCoin();
this.autoSetActiveCoin(coin);
setTimeout(() => {
Store.dispatch(dashboardRemoveCoin(coin));
}, 500);
@ -250,9 +253,10 @@ class CoinTileItem extends React.Component {
}
}
_dashboardChangeActiveCoin(coin, mode) {
_dashboardChangeActiveCoin(coin, mode, skipCoinsArrUpdate) {
if (coin !== this.props.ActiveCoin.coin) {
Store.dispatch(dashboardChangeActiveCoin(coin, mode));
console.warn('_dashboardChangeActiveCoin', skipCoinsArrUpdate);
Store.dispatch(dashboardChangeActiveCoin(coin, mode, skipCoinsArrUpdate));
setTimeout(() => {
this.dispatchCoinActions(coin, mode);
}, 100);

2
react/src/components/dashboard/importKeyModal/importKeyModal.js

@ -188,7 +188,7 @@ class ImportKeyModal extends React.Component {
}
});
this.state({
this.setState({
passphraseWif: null,
passphraseAddress: null,
wifkeysPassphrase: null,

2
react/src/components/dashboard/walletsBalance/walletsBalance.js

@ -66,8 +66,8 @@ class WalletsBalance extends React.Component {
}
renderBalance(type) {
let _balance = 0;
const _mode = this.props.ActiveCoin.mode;
let _balance = 0;
if (this.props.ActiveCoin.balance === 'connection error or incomplete data') {
_balance = '-777';

10
react/src/reducers/activeCoin.js

@ -71,7 +71,10 @@ export function ActiveCoin(state = {
getinfoFetchFailures: state.getinfoFetchFailures,
};
let _coins = state.coins;
_coins[state.coin] = _coinDataToStore;
if (!action.skip) {
_coins[state.coin] = _coinDataToStore;
}
delete _coins.undefined;
return {
@ -115,7 +118,10 @@ export function ActiveCoin(state = {
getinfoFetchFailures: state.getinfoFetchFailures,
};
let _coins = state.coins;
_coins[state.coin] = _coinData;
if (!action.skip) {
_coins[state.coin] = _coinData;
}
return {
...state,

2
react/src/translate/en.js

@ -453,7 +453,7 @@ export const _lang = {
'SPV_CONN_ERROR': 'Connection error!',
'SPV_CONN_ERROR_P1': 'Try to connect to another SPV server.',
'SPV_CONN_ERROR_P2': 'To do that go to "Settings", select "SPV Server List" tab, choose new server and click "OK".',
'FAILED_TX_INFO': 'Transaction failed or block reindexing is in progress. Failed transactions usually rejected after a while resulting in your funds being credited back.',
'FAILED_TX_INFO': 'Transaction failed or blocks reindexing is in progress. Failed transactions usually rejected after a while resulting in your funds being credited back.',
'SPV_CLAIMED_INTEREST': 'Claimed interest',
'CLAIM_INTEREST_HELPER_BAR_P1': 'You have',
'CLAIM_INTEREST_HELPER_BAR_P2': 'to claim',

Loading…
Cancel
Save