diff options
author | jloup <jeanloup.jamet@gmail.com> | 2018-05-07 18:50:53 +0200 |
---|---|---|
committer | jloup <jeanloup.jamet@gmail.com> | 2018-05-07 18:50:53 +0200 |
commit | 78e3e81ddf01f41102f3f4e32c5a3955cf5fb04f (patch) | |
tree | f94389fe0e5fd4645963511cb10b8c6582b42ac9 | |
parent | 84cce85f9f8a24d65c4abc9a544a691240269f59 (diff) | |
download | Front-78e3e81ddf01f41102f3f4e32c5a3955cf5fb04f.tar.gz Front-78e3e81ddf01f41102f3f4e32c5a3955cf5fb04f.tar.zst Front-78e3e81ddf01f41102f3f4e32c5a3955cf5fb04f.zip |
Various fixes.
-rw-r--r-- | cmd/web/Makefile | 6 | ||||
-rw-r--r-- | cmd/web/js/poloniex.jsx | 11 |
2 files changed, 8 insertions, 9 deletions
diff --git a/cmd/web/Makefile b/cmd/web/Makefile index 3b100d1..52e2289 100644 --- a/cmd/web/Makefile +++ b/cmd/web/Makefile | |||
@@ -20,7 +20,7 @@ install: | |||
20 | yarn --version | 20 | yarn --version |
21 | yarn install | 21 | yarn install |
22 | 22 | ||
23 | static: $(STATIC_BUILD_DIR) js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) $(ICONS) | 23 | static: $(STATIC_BUILD_DIR) $(STATIC_BUILD_DIR)/fonts js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) $(ICONS) |
24 | 24 | ||
25 | js: build/static/main.js | 25 | js: build/static/main.js |
26 | 26 | ||
@@ -32,7 +32,9 @@ $(STATIC_BUILD_DIR): | |||
32 | mkdir -p $@ | 32 | mkdir -p $@ |
33 | mkdir -p $@/icons/black | 33 | mkdir -p $@/icons/black |
34 | mkdir -p $@/icons/color | 34 | mkdir -p $@/icons/color |
35 | mkdir -p $@/fonts | 35 | |
36 | $(STATIC_BUILD_DIR)/fonts: | ||
37 | mkdir -p $@ | ||
36 | 38 | ||
37 | $(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx | 39 | $(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx |
38 | eslint --fix $< | 40 | eslint --fix $< |
diff --git a/cmd/web/js/poloniex.jsx b/cmd/web/js/poloniex.jsx index 76b68d8..edac368 100644 --- a/cmd/web/js/poloniex.jsx +++ b/cmd/web/js/poloniex.jsx | |||
@@ -4,7 +4,7 @@ import React from 'react'; | |||
4 | class PoloniexController extends React.Component { | 4 | class PoloniexController extends React.Component { |
5 | constructor(props) { | 5 | constructor(props) { |
6 | super(props); | 6 | super(props); |
7 | this.state = {'apiRequested': false, 'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null}; | 7 | this.state = {'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null}; |
8 | } | 8 | } |
9 | 9 | ||
10 | loadBalance = () => { | 10 | loadBalance = () => { |
@@ -12,14 +12,14 @@ class PoloniexController extends React.Component { | |||
12 | if (err) { | 12 | if (err) { |
13 | console.error(err, data); | 13 | console.error(err, data); |
14 | if (err.code === 'invalid_market_credentials') { | 14 | if (err.code === 'invalid_market_credentials') { |
15 | this.setState({'flag': 'invalidCredentials', 'apiRequested': true, 'valueCurrency': null, 'balanceValue': null, 'balance': null}); | 15 | this.setState({'flag': 'invalidCredentials', 'valueCurrency': null, 'balanceValue': null, 'balance': null}); |
16 | } else if (err.code === 'ip_restricted_api_key') { | 16 | } else if (err.code === 'ip_restricted_api_key') { |
17 | this.setState({'flag': 'ipRestricted', 'apiRequested': true, 'valueCurrency': null, 'balanceValue': null, 'balance': null}); | 17 | this.setState({'flag': 'ipRestricted', 'valueCurrency': null, 'balanceValue': null, 'balance': null}); |
18 | } | 18 | } |
19 | return; | 19 | return; |
20 | } | 20 | } |
21 | 21 | ||
22 | this.setState({'flag': 'ok', 'apiRequested': true, 'valueCurrency': data.valueCurrency, 'balanceValue': data.value, 'balance': data.balance}); | 22 | this.setState({'flag': 'ok', 'valueCurrency': data.valueCurrency, 'balanceValue': data.value, 'balance': data.balance}); |
23 | }.bind(this)); | 23 | }.bind(this)); |
24 | } | 24 | } |
25 | 25 | ||
@@ -41,9 +41,6 @@ class PoloniexController extends React.Component { | |||
41 | default: | 41 | default: |
42 | displayText = null; | 42 | displayText = null; |
43 | } | 43 | } |
44 | if (this.state.apiRequested === false) { | ||
45 | return <div></div>; | ||
46 | } | ||
47 | return ( | 44 | return ( |
48 | <div> | 45 | <div> |
49 | <PoloniexBalance balanceCurrency={this.state.valueCurrency} | 46 | <PoloniexBalance balanceCurrency={this.state.valueCurrency} |