Skip to content

Commit

Permalink
Update master branch for 0.9.14 (#540)
Browse files Browse the repository at this point in the history
* Fix BN error

* toEth

* Electron Icon (#466)

* Add electron icons

* Remove leftovers

* Update version number

* Fix tests on new jest update

* Update version

* Package-json

* Remove win icon

* Win icon electron

* Wrong name
  • Loading branch information
josipbagaric authored Aug 17, 2018
1 parent be5131b commit 1ac2802
Show file tree
Hide file tree
Showing 8 changed files with 4,205 additions and 4,214 deletions.
Binary file added app/assets/img/electron/icon-osx.icns
Binary file not shown.
Binary file added app/assets/img/electron/icon.ico
Binary file not shown.
Binary file added app/assets/img/electron/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 9 additions & 11 deletions app/components/TimeNode/TimeNodeSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,25 @@ class TimeNodeSettings extends Component {
super(props);

const { maxDeposit, minProfitability, minBalance } = props.timeNodeStore.economicStrategy;

const toEth = wei => this.props.timeNodeStore._web3Service.fromWei(wei, 'ether');
const hasPropertyOrNotDefault = strategy => {
if (!strategy) {
return false;
}
const setStrategy = props.timeNodeStore.economicStrategy[strategy];
const defaultStrategy = Config.DEFAULT_ECONOMIC_STRATEGY[strategy];
const defaultStrategy = Config.DEFAULT_ECONOMIC_STRATEGY[strategy].toString();
return setStrategy !== defaultStrategy;
};

this.state = {
claiming: props.timeNodeStore.claiming,
maxDeposit: hasPropertyOrNotDefault('maxDeposit') ? toEth(maxDeposit) : '',
minProfitability: hasPropertyOrNotDefault('minProfitability') ? toEth(minProfitability) : '',
minBalance: hasPropertyOrNotDefault('minBalance') ? toEth(minBalance) : ''
minBalance: hasPropertyOrNotDefault('minBalance') ? toEth(minBalance) : '',
defaultMaxDeposit: toEth(Config.DEFAULT_ECONOMIC_STRATEGY.maxDeposit),
defaultMinProfitability: toEth(Config.DEFAULT_ECONOMIC_STRATEGY.minProfitability),
defaultMinBalance: toEth(Config.DEFAULT_ECONOMIC_STRATEGY.minBalance)
};
this.handleChange = this.handleChange.bind(this);
this.toggleClaiming = this.toggleClaiming.bind(this);
Expand Down Expand Up @@ -99,9 +103,7 @@ class TimeNodeSettings extends Component {
id="maxDeposit"
className="form-control"
type="number"
placeholder={
'Default: ' + Config.DEFAULT_ECONOMIC_STRATEGY.maxDeposit + ' ETH'
}
placeholder={`Default: ${this.state.defaultMaxDeposit} ETH`}
value={this.state.maxDeposit}
onChange={this.handleChange}
/>
Expand All @@ -115,9 +117,7 @@ class TimeNodeSettings extends Component {
id="minProfitability"
className="form-control"
type="number"
placeholder={
'Default: ' + Config.DEFAULT_ECONOMIC_STRATEGY.minProfitability + ' ETH'
}
placeholder={`Default: ${this.state.defaultMinProfitability} ETH`}
value={this.state.minProfitability}
onChange={this.handleChange}
/>
Expand All @@ -131,9 +131,7 @@ class TimeNodeSettings extends Component {
id="minBalance"
className="form-control"
type="number"
placeholder={
'Default: ' + Config.DEFAULT_ECONOMIC_STRATEGY.minBalance + ' ETH'
}
placeholder={`Default: ${this.state.defaultMinBalance} ETH`}
value={this.state.minBalance}
onChange={this.handleChange}
/>
Expand Down
3 changes: 2 additions & 1 deletion app/stores/KeenStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const COLLECTIONS = {
const ACTIVE_TIMENODES_POLLING_INTERVAL = 2 * 60 * 1000;

export class KeenStore {
@observable activeTimeNodes = null;
@observable
activeTimeNodes = null;

projectId = '';
writeKey = '';
Expand Down
5 changes: 2 additions & 3 deletions app/stores/TimeNodeStore.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { observable, computed } from 'mobx';
import CryptoJS from 'crypto-js';
import ethereumJsWallet from 'ethereumjs-wallet';
import BigNumber from 'bignumber.js';
import EacWorker from 'worker-loader!../js/eac-worker.js';
import { EAC_WORKER_MESSAGE_TYPES } from '../js/eac-worker-message-types';
import { showNotification } from '../services/notification';
Expand Down Expand Up @@ -77,9 +76,9 @@ export default class TimeNodeStore {

@computed
get economicStrategy() {
const load = (strategy) => {
const load = strategy => {
const loaded = this._storageService.load(strategy);
return loaded ? new BigNumber(loaded) : Config.DEFAULT_ECONOMIC_STRATEGY[strategy];
return loaded ? loaded : Config.DEFAULT_ECONOMIC_STRATEGY[strategy].toString();
};

return {
Expand Down
Loading

0 comments on commit 1ac2802

Please sign in to comment.