]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git/commitdiff
Various fixes.
authorjloup <jeanloup.jamet@gmail.com>
Mon, 7 May 2018 16:50:53 +0000 (18:50 +0200)
committerjloup <jeanloup.jamet@gmail.com>
Mon, 7 May 2018 16:50:53 +0000 (18:50 +0200)
cmd/web/Makefile
cmd/web/js/poloniex.jsx

index 3b100d16d8e43656bcaa610c5c203957a82fb7f2..52e2289a9adc4b27b5738a653adca28a6725e34d 100644 (file)
@@ -20,7 +20,7 @@ install:
        yarn --version
        yarn install
 
-static: $(STATIC_BUILD_DIR) js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) $(ICONS)
+static: $(STATIC_BUILD_DIR) $(STATIC_BUILD_DIR)/fonts js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) $(ICONS)
 
 js: build/static/main.js
 
@@ -32,7 +32,9 @@ $(STATIC_BUILD_DIR):
        mkdir -p $@
        mkdir -p $@/icons/black
        mkdir -p $@/icons/color
-       mkdir -p $@/fonts
+
+$(STATIC_BUILD_DIR)/fonts:
+       mkdir -p $@
 
 $(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx
        eslint --fix $<
index 76b68d8913312ff7f3640b4f87c98804c3311284..edac368e84d07f02d2060d838481d7853cab04a3 100644 (file)
@@ -4,7 +4,7 @@ import React from 'react';
 class PoloniexController extends React.Component {
   constructor(props) {
     super(props);
-    this.state = {'apiRequested': false, 'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null};
+    this.state = {'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null};
   }
 
   loadBalance = () => {
@@ -12,14 +12,14 @@ class PoloniexController extends React.Component {
       if (err) {
         console.error(err, data);
         if (err.code === 'invalid_market_credentials') {
-          this.setState({'flag': 'invalidCredentials', 'apiRequested': true, 'valueCurrency': null, 'balanceValue': null, 'balance': null});
+          this.setState({'flag': 'invalidCredentials', 'valueCurrency': null, 'balanceValue': null, 'balance': null});
         } else if (err.code === 'ip_restricted_api_key') {
-          this.setState({'flag': 'ipRestricted', 'apiRequested': true, 'valueCurrency': null, 'balanceValue': null, 'balance': null});
+          this.setState({'flag': 'ipRestricted', 'valueCurrency': null, 'balanceValue': null, 'balance': null});
         }
         return;
       }
 
-      this.setState({'flag': 'ok', 'apiRequested': true, 'valueCurrency': data.valueCurrency, 'balanceValue': data.value, 'balance': data.balance});
+      this.setState({'flag': 'ok', 'valueCurrency': data.valueCurrency, 'balanceValue': data.value, 'balance': data.balance});
     }.bind(this));
   }
 
@@ -41,9 +41,6 @@ class PoloniexController extends React.Component {
       default:
         displayText = null;
     }
-    if (this.state.apiRequested === false) {
-      return <div></div>;
-    }
     return (
       <div>
         <PoloniexBalance  balanceCurrency={this.state.valueCurrency}