Browse Source

komodo datadir param

all-modes
pbca26 8 years ago
parent
commit
d60899e55b
  1. 5
      react/change.log
  2. 45
      react/src/components/dashboard/settings/settings.js
  3. 9
      react/src/components/overrides.scss

5
react/change.log

@ -21,6 +21,11 @@ UI:
- zcashparams folder check
- claim interest modal
- renewed transactions history look
- prevent app from closing while komodod is still loading/processing data
- send form validation
- coin daemon port check on addcoin
- updated application settings
- komodo datadir
v0.2.0.21a-beta
--------------

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

@ -16,6 +16,7 @@ import {
shepherdCli,
checkForUpdateUIPromise,
updateUIPromise,
triggerToaster,
} from '../../../actions/actionCreators';
import Store from '../../../store';
@ -447,17 +448,53 @@ class Settings extends React.Component {
_saveAppConfig() {
const _appSettings = this.state.appSettings;
let _appSettingsPristine = Object.assign({}, this.props.Settings.appSettings);
let isError = false;
let saveAfterPathCheck = false;
for (let key in _appSettings) {
if (key.indexOf('__') === -1) {
_appSettingsPristine[key] = this.state.appConfigSchema[key].type === 'number' ? Number(_appSettings[key]) : _appSettings[key];
if (this.state.appConfigSchema[key].type === 'folder' &&
_appSettings[key] &&
_appSettings[key].length) {
const _testLocation = window.require('electron').remote.getCurrentWindow().testLocation;
saveAfterPathCheck = true;
_testLocation(_appSettings[key])
.then((res) => {
if (res === -1) {
isError = true;
Store.dispatch(
triggerToaster(
'Komodo datadir path is invalid',
translate('INDEX.SETTINGS'),
'error'
)
);
} else if (res === false) {
isError = true;
Store.dispatch(
triggerToaster(
'Komodo datadir path is not a directory',
translate('INDEX.SETTINGS'),
'error'
)
);
} else {
Store.dispatch(saveAppConfig(_appSettingsPristine));
}
});
}
} else {
const _nestedKey = key.split('__');
_appSettingsPristine[_nestedKey[0]][_nestedKey[1]] = this.state.appConfigSchema[_nestedKey[0]][_nestedKey[1]].type === 'number' ? Number(_appSettings[key]) : _appSettings[key];
}
}
Store.dispatch(saveAppConfig(_appSettingsPristine));
if (!saveAfterPathCheck) {
Store.dispatch(saveAppConfig(_appSettingsPristine));
}
}
renderConfigEditForm() {
@ -502,11 +539,12 @@ class Settings extends React.Component {
value={ _appConfig[key][_key] }
onChange={ (event) => this.updateInputSettings(event, key, _key) } />
}
{ this.state.appConfigSchema[key][_key].type === 'string' &&
{ (this.state.appConfigSchema[key][_key].type === 'string' || this.state.appConfigSchema[key][_key].type === 'folder') &&
<input
type="text"
name={ `${key}__${_key}` }
value={ _appConfig[key][_key] }
className={ this.state.appConfigSchema[key][_key].type === 'folder' ? 'full-width': '' }
onChange={ (event) => this.updateInputSettings(event, key, _key) } />
}
{ this.state.appConfigSchema[key][_key].type === 'boolean' &&
@ -549,11 +587,12 @@ class Settings extends React.Component {
value={ _appConfig[key] }
onChange={ (event) => this.updateInputSettings(event, key) } />
}
{ this.state.appConfigSchema[key].type === 'string' &&
{ (this.state.appConfigSchema[key].type === 'string' || this.state.appConfigSchema[key].type === 'folder') &&
<input
type="text"
name={ `${key}` }
value={ _appConfig[key] }
className={ this.state.appConfigSchema[key].type === 'folder' ? 'full-width': '' }
onChange={ (event) => this.updateInputSettings(event, key) } />
}
{ this.state.appConfigSchema[key].type === 'boolean' &&

9
react/src/components/overrides.scss

@ -1071,6 +1071,13 @@ select{
top: 4px;
}
table {
width: 80%;
width: 100%;
td:first-child {
width: 40%;
}
td:last-child {
width: 60%;
}
}
}
Loading…
Cancel
Save