Browse Source

pre-select coin on load fix

all-modes
pbca26 8 years ago
parent
commit
a8bce02e61
  1. BIN
      assets/mainWindow/img/fa-caret-down.png
  2. BIN
      assets/mainWindow/img/fa-caret-up.png
  3. 5
      assets/mainWindow/js/loading.js
  4. 2
      react/src/actions/actions/addCoin.js
  5. 16
      react/src/components/dashboard/coinTile/coinTileItem.js
  6. 2
      react/src/components/dashboard/coinTile/coinTileItem.render.js
  7. 2
      react/src/components/dashboard/walletsNav/walletsNav.js

BIN
assets/mainWindow/img/fa-caret-down.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/mainWindow/img/fa-caret-up.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

5
assets/mainWindow/js/loading.js

@ -182,12 +182,13 @@ function openSettingsWindow() {
window.createAppSettingsWindow();
}
function closeMainWindow() {
function closeMainWindow(isKmdOnly) {
const remote = require('electron').remote;
const window = remote.getCurrentWindow();
toggleDropdown();
disableModeButtons();
window.startKMDNative(isKmdOnly ? 'kmd' : null);
window.createWindow('open');
window.hide();
@ -204,6 +205,7 @@ function disableModeButtons() {
$('#nativeOnlyBtn').attr('disabled', true);
$('#normalStartBtn').attr('disabled', true);
$('#settingsBtn').attr('disabled', true);
$('#nativeOnlyBtnCarret').attr('disabled', true);
}
function normalStart() {
@ -211,6 +213,7 @@ function normalStart() {
let appConf = remote.getCurrentWindow().appConfig;
appConf.iguanaLessMode = false;
toggleDropdown();
disableModeButtons();
// run iguana-less mode with no daemons startup

2
react/src/actions/actions/addCoin.js

@ -342,7 +342,7 @@ export function iguanaActiveHandleBypass() {
.then(response => response.json())
.then(
json => dispatch(
iguanaWalletPassphraseState(json, dispatch)
iguanaWalletPassphraseState(json, dispatch, true)
)
)
}

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

@ -42,6 +42,9 @@ class CoinTileItem extends React.Component {
componentWillMount() {
if (!this.props.ActiveCoin.coin) {
let _coinSelected = false;
let _mode;
let _coin;
const modes = [
'native',
'basilisk',
@ -52,11 +55,16 @@ class CoinTileItem extends React.Component {
if (allCoins) {
modes.map((mode) => {
allCoins[mode].map((coin) => {
setTimeout(() => {
this.dashboardChangeActiveCoin(coin, mode);
}, 100);
if (!_coinSelected) {
_coinSelected = true;
_coin = coin;
_mode = mode;
}
});
});
setTimeout(() => {
this._dashboardChangeActiveCoin(_coin, _mode);
}, 100);
}
}
}
@ -123,7 +131,7 @@ class CoinTileItem extends React.Component {
}
}
dashboardChangeActiveCoin(coin, mode) {
_dashboardChangeActiveCoin(coin, mode) {
if (coin !== this.props.ActiveCoin.coin) {
Store.dispatch(dashboardChangeActiveCoin(coin, mode));
setTimeout(() => {

2
react/src/components/dashboard/coinTile/coinTileItem.render.js

@ -8,7 +8,7 @@ const CoinTileItemRender = function() {
<div className={ 'widget widget-shadow' + (this.props.ActiveCoin.coin === item.coin ? ' active' : '') }>
<div
className="widget-content text-center bg-white padding-20"
onClick={ () => this.dashboardChangeActiveCoin(item.coin, item.mode) }>
onClick={ () => this._dashboardChangeActiveCoin(item.coin, item.mode) }>
<a className="avatar margin-bottom-5">
<img
className="img-responsive"

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

@ -115,7 +115,7 @@ class WalletsNav extends React.Component {
if (this.props &&
this.props.ActiveCoin &&
!this.props.ActiveCoin.coin) {
return WalletsNavNoWalletRender.call(this);
return null; //WalletsNavNoWalletRender.call(this);
}
return WalletsNavWithWalletRender.call(this);

Loading…
Cancel
Save