Browse Source

settings option to skip full dashboard update in kmd native

all-modes
pbca26 8 years ago
parent
commit
63ce2063b1
  1. 6
      assets/mainWindow/css/loading.css
  2. 21
      assets/mainWindow/js/loading.js
  3. 10
      react/src/actions/actionCreators.js
  4. 1
      react/src/actions/storeType.js
  5. 42
      react/src/components/dashboard/claimInterestModal/claimInterestModal.render.js
  6. 5
      react/src/components/dashboard/coinTile/coinTileItem.js
  7. 38
      react/src/components/dashboard/receiveCoin/receiveCoin.js
  8. 33
      react/src/components/dashboard/settings/settings.js
  9. 2
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js
  10. 2
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js
  11. 9
      react/src/reducers/dashboard.js

6
assets/mainWindow/css/loading.css

@ -33,7 +33,11 @@ body.agamaMode {
background-color: rgba(33, 33, 33, 0.85);
padding-top: 40px;
color: #fff;
height: 335px;
height: 300px;
}
body.loading-window {
height: 355px;
}
body.agama-default-window-height {

21
assets/mainWindow/js/loading.js

@ -182,6 +182,21 @@ function openSettingsWindow() {
window.createAppSettingsWindow();
}
function startKMDPassive() {
const remote = require('electron').remote;
const window = remote.getCurrentWindow();
$('.dropdown-menu').addClass('hide');
disableModeButtons();
window.startKMDNative('KMD', true);
setTimeout(function() {
window.createWindow('open');
window.hide();
}, 1000);
}
function closeMainWindow(isKmdOnly, isCustom) {
const remote = require('electron').remote;
const window = remote.getCurrentWindow();
@ -193,8 +208,10 @@ function closeMainWindow(isKmdOnly, isCustom) {
window.startKMDNative(isKmdOnly ? 'KMD' : null);
}
window.createWindow('open');
window.hide();
setTimeout(function() {
window.createWindow('open');
window.hide();
}, 3000);
}
function quitApp() {

10
react/src/actions/actionCreators.js

@ -28,7 +28,8 @@ import {
DISPLAY_COIND_DOWN_MODAL,
DISPLAY_CLAIM_INTEREST_MODAL,
START_INTERVAL,
STOP_INTERVAL
STOP_INTERVAL,
DASHBOARD_SYNC_ONLY_UPDATE,
} from './storeType';
export * from './actions/nativeSyncInfo';
@ -341,4 +342,11 @@ export function toggleClaimInterestModal(display) {
type: DISPLAY_CLAIM_INTEREST_MODAL,
displayClaimInterestModal: display,
}
}
export function skipFullDashboardUpdate(skip) {
return {
type: DASHBOARD_SYNC_ONLY_UPDATE,
skipFullDashboardUpdate: skip,
}
}

1
react/src/actions/storeType.js

@ -31,6 +31,7 @@ export const DASHBOARD_ACTIVE_COIN_SENDTO = 'DASHBOARD_ACTIVE_COIN_SENDTO';
export const DASHBOARD_ACTIVE_COIN_GET_CACHE = 'DASHBOARD_ACTIVE_COIN_GET_CACHE';
export const DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR = 'DASHBOARD_ACTIVE_COIN_MAIN_BASILISK_ADDR';
export const DASHBOARD_UPDATE = 'DASHBOARD_UPDATE';
export const DASHBOARD_SYNC_ONLY_UPDATE = 'DASHBOARD_SYNC_ONLY_UPDATE';
export const VIEW_CACHE_DATA = 'VIEW_CACHE_DATA';
export const SYNC_ONLY_MODAL_TOGGLE = 'SYNC_ONLY_MODAL_TOGGLE';
export const SYNC_ONLY_DATA = 'SYNC_ONLY_DATA';

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

@ -46,27 +46,29 @@ export const _ClaimInterestTableRender = function() {
<strong>{ translate('CLAIM_INTEREST.TIP') }:</strong> { translate('CLAIM_INTEREST.TIP_DESC') }
</p>
</div>
<div className="text-left padding-top-10 padding-bottom-10">
<label className="switch">
<input
type="checkbox"
checked={ this.state.showZeroInterest } />
{ this.state.totalInterest > 0 &&
<div className="text-left padding-top-10 padding-bottom-10">
<label className="switch">
<input
type="checkbox"
checked={ this.state.showZeroInterest } />
<div
className="slider"
onClick={ this.toggleZeroInterest }></div>
</label>
<div
className="slider"
onClick={ this.toggleZeroInterest }></div>
</label>
<div
className="toggle-label margin-right-15 pointer"
onClick={ this.toggleZeroInterest }>
Show zero interest
className="toggle-label margin-right-15 pointer"
onClick={ this.toggleZeroInterest }>
Show zero interest
</div>
<button
type="button"
className="btn btn-success waves-effect waves-light claim-btn"
onClick={ () => this.claimInterest() }>
<i className="icon fa-dollar"></i> { translate('CLAIM_INTEREST.CLAIM_INTEREST', `${this.state.totalInterest} KMD `) }
</button>
</div>
<button
type="button"
className="btn btn-success waves-effect waves-light claim-btn"
onClick={ () => this.claimInterest() }>
<i className="icon fa-dollar"></i> { translate('CLAIM_INTEREST.CLAIM_INTEREST', `${this.state.totalInterest} KMD `) }
</button>
</div>
}
<div className="table-scroll">
<table className="table table-hover dataTable table-striped">
<thead>
@ -109,7 +111,7 @@ export const ClaimInterestModalRender = function() {
onClick={ this.closeModal }>
<span>×</span>
</button>
<h4 className="modal-title white text-left">{ translate('CLAIM_INTEREST.CLAIM_INTEREST') }</h4>
<h4 className="modal-title white text-left">{ translate('CLAIM_INTEREST.CLAIM_INTEREST', ' ') }</h4>
</div>
<div className="modal-body">
<i

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

@ -86,7 +86,10 @@ class CoinTileItem extends React.Component {
syncPercentage &&
(Config.iguanaLessMode || syncPercentage >= NATIVE_MIN_SYNC_PERCENTAGE_THRESHOLD)) {
Store.dispatch(getSyncInfoNative(coin, true));
Store.dispatch(getDashboardUpdate(coin, _propsDashboard));
if (!this.props.Dashboard.skipFullDashboardUpdate) {
Store.dispatch(getDashboardUpdate(coin, _propsDashboard));
}
} else {
Store.dispatch(getSyncInfoNative(coin));
}

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

@ -217,33 +217,27 @@ class ReceiveCoin extends React.Component {
return null;
}
}
const mapStateToProps = (state, props) => {
let _mappedProps = {
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
receive: state.ActiveCoin.receive,
balance: state.ActiveCoin.balance,
cache: state.ActiveCoin.cache,
activeSection: state.ActiveCoin.activeSection,
activeAddress: state.ActiveCoin.activeAddress,
addresses: state.ActiveCoin.addresses,
};
if (props &&
props.activeSection &&
props.renderTableOnly) {
return {
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
receive: state.ActiveCoin.receive,
balance: state.ActiveCoin.balance,
cache: state.ActiveCoin.cache,
activeSection: props.activeSection,
activeAddress: state.ActiveCoin.activeAddress,
addresses: state.ActiveCoin.addresses,
renderTableOnly: props.renderTableOnly,
};
} else {
return {
coin: state.ActiveCoin.coin,
mode: state.ActiveCoin.mode,
receive: state.ActiveCoin.receive,
balance: state.ActiveCoin.balance,
cache: state.ActiveCoin.cache,
activeSection: state.ActiveCoin.activeSection,
activeAddress: state.ActiveCoin.activeAddress,
addresses: state.ActiveCoin.addresses,
};
_mappedProps.ActiveCoin.activeSection = props.activeSection;
_mappedProps.renderTableOnly = props.renderTableOnly;
}
return _mappedProps;
};
export default connect(mapStateToProps)(ReceiveCoin);

33
react/src/components/dashboard/settings/settings.js

@ -18,6 +18,7 @@ import {
checkForUpdateUIPromise,
updateUIPromise,
triggerToaster,
skipFullDashboardUpdate,
} from '../../../actions/actionCreators';
import Store from '../../../store';
@ -69,7 +70,6 @@ class Settings extends React.Component {
};
this.exportWifKeys = this.exportWifKeys.bind(this);
this.updateInput = this.updateInput.bind(this);
// this.updateInputSettings = this.updateInputSettings.bind(this);
this.importWifKey = this.importWifKey.bind(this);
this.readDebugLog = this.readDebugLog.bind(this);
this.checkNodes = this.checkNodes.bind(this);
@ -83,6 +83,11 @@ class Settings extends React.Component {
this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this);
this._updateUIPromise = this._updateUIPromise.bind(this);
this.updateTabDimensions = this.updateTabDimensions.bind(this);
this._skipFullDashboardUpdate = this._skipFullDashboardUpdate.bind(this);
}
_skipFullDashboardUpdate() {
Store.dispatch(skipFullDashboardUpdate(!this.props.Dashboard.skipFullDashboardUpdate));
}
updateTabDimensions() {
@ -615,6 +620,31 @@ class Settings extends React.Component {
}
}
items.push(
<tr key={ `kmd-main-sync-only` }>
<td className="padding-15">
KMD main sync only
<i
className="icon fa-question-circle settings-help"
title="Fetch block synchronization data only. Skip any other requests that can deteriorate sync speed."></i>
</td>
<td className="padding-15">
<span className="pointer toggle">
<label className="switch">
<input
type="checkbox"
name={ `kmd-main-sync-only` }
value={ this.props.Dashboard.skipFullDashboardUpdate }
checked={ this.props.Dashboard.skipFullDashboardUpdate } />
<div
className="slider"
onClick={ this._skipFullDashboardUpdate }></div>
</label>
</span>
</td>
</tr>
);
return items;
}
@ -856,6 +886,7 @@ const mapStateToProps = (state) => {
coin: state.ActiveCoin.coin,
},
Settings: state.Settings,
Dashboard: state.Dashboard,
};
};

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

@ -468,7 +468,7 @@ const mapStateToProps = (state, props) => {
if (props &&
props.activeSection &&
props.renderFormOnly) {
_mappedProps.ActiveCoin.activeSection = props.activeSection,
_mappedProps.ActiveCoin.activeSection = props.activeSection;
_mappedProps.renderFormOnly = props.renderFormOnly;
}

2
react/src/components/dashboard/walletsNativeSend/walletsNativeSend.render.js

@ -35,8 +35,6 @@ export const AddressListRender = function() {
);
};
// { this.renderAddressByType('public') }
export const OASendUIRender = function() {
return (
<div className="row">

9
react/src/reducers/dashboard.js

@ -4,7 +4,8 @@ import {
VIEW_CACHE_DATA,
TOGGLE_NOTIFICATIONS_MODAL,
DISPLAY_COIND_DOWN_MODAL,
DISPLAY_CLAIM_INTEREST_MODAL
DISPLAY_CLAIM_INTEREST_MODAL,
DASHBOARD_SYNC_ONLY_UPDATE
} from '../actions/storeType';
export function Dashboard(state = {
@ -14,6 +15,7 @@ export function Dashboard(state = {
guiLog: {},
displayCoindDownModal: false,
displayClaimInterestModal: false,
skipFullDashboardUpdate: false,
}, action) {
switch (action.type) {
case DASHBOARD_SECTION_CHANGE:
@ -43,6 +45,11 @@ export function Dashboard(state = {
displayClaimInterestModal: action.displayClaimInterestModal,
};
break;
case DASHBOARD_SYNC_ONLY_UPDATE:
return {
...state,
skipFullDashboardUpdate: action.skipFullDashboardUpdate,
};
default:
return state;
}

Loading…
Cancel
Save