From 4411ae1564d716e5aa063e4c47302ffc907a078a Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Tue, 20 Apr 2021 12:49:22 -0400 Subject: Fixed the crash if no data in timetime and hid if an investor has no holidngs. --- react-frontend/src/components/HubWidget.js | 2 +- react-frontend/src/components/InvestorInfo.js | 12 ++++++------ react-frontend/src/components/WatchDogs.js | 5 +++++ react-frontend/src/css/UserCheckin.css | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/react-frontend/src/components/HubWidget.js b/react-frontend/src/components/HubWidget.js index 7a82c61..f0434d7 100644 --- a/react-frontend/src/components/HubWidget.js +++ b/react-frontend/src/components/HubWidget.js @@ -61,7 +61,7 @@ function HubWidget(props) {

- setQueryString(e.target.value)} placeholder="Search by name"> + setQueryString(e.target.value)} placeholder="Search by name"> setSearching(true)} src="assets/outline_search_white_18dp.png" alt="image"/> setSearching(false)} src="assets/outline_cancel_white_18dp.png" alt="image"/>

diff --git a/react-frontend/src/components/InvestorInfo.js b/react-frontend/src/components/InvestorInfo.js index 436fa17..9e18299 100644 --- a/react-frontend/src/components/InvestorInfo.js +++ b/react-frontend/src/components/InvestorInfo.js @@ -48,13 +48,13 @@ function InvestorInfo(props) { }, credentials: "same-origin", }) - .then((res) => res.json()) - .then((data) => { + .then(res => res.json()) + .then(data => { console.log(data); setInfo(data); props.setShowSelectedInfo(true); }) - .catch((err) => console.log(err)); + .catch(err => console.log(err)); }; const stockTable = () => { @@ -104,7 +104,7 @@ function InvestorInfo(props) {
-

{(info.moneyOut - info.moneyIn).toFixed(3)}$

gain +

${(info.moneyOut - info.moneyIn).toFixed(3)}

gained
@@ -114,9 +114,9 @@ function InvestorInfo(props) {
-
+