diff --git a/public/src/components/Main.tsx b/public/src/components/Main.tsx index 22bc809..9fa0847 100644 --- a/public/src/components/Main.tsx +++ b/public/src/components/Main.tsx @@ -103,9 +103,9 @@ export class Main extends React.Component { stockDetails: [], latestTransaction: new Transaction_pb, networkTimeOut: moment(), - networkTimeOutCounterNotifs: 2, - networkTimeOutCounterTrans: 2, - networkTimeOutCounterPrices: 2, + networkTimeOutCounterNotifs: 1, + networkTimeOutCounterTrans: 1, + networkTimeOutCounterPrices: 1, successCounter: 0, connectionStatus: true, }; @@ -142,9 +142,9 @@ export class Main extends React.Component { this.setState({ networkTimeOut: moment(), successCounter: 0, - networkTimeOutCounterNotifs: 2, - networkTimeOutCounterTrans: 2, - networkTimeOutCounterPrices: 2, + networkTimeOutCounterNotifs: 1, + networkTimeOutCounterTrans: 1, + networkTimeOutCounterPrices: 1, connectionStatus: true, }); } else { @@ -187,7 +187,7 @@ export class Main extends React.Component { let counter = this.getStreamCounter(flag); if(counter != -1 && counter <= 3600) { - counter = counter * 2; + counter = counter * 1.24; this.setStreamCounter(flag,counter); const endtime = moment(); if(endtime.diff(this.state.networkTimeOut) >= 20000) @@ -196,8 +196,9 @@ export class Main extends React.Component { networkTimeOut: moment(), }); PNotify.removeAll(); - showErrorNotif("Unable to connect to server. Please check your internet connection. Retrying in " + (counter) + "s", "Network error"); - } + + showErrorNotif("Unable to connect to server. Please check your internet connection. Retrying in " + (Math.round(counter)) + "s", "Network error"); + } setTimeout(func,counter*1000); } } @@ -210,6 +211,16 @@ export class Main extends React.Component { notifReq.setCount(10); try { const notifs = await DalalActionService.getNotifications(notifReq, sessionMd); + if(notifs.getNotificationsList().length === 0){ + let blankNotif : Notification_pb = new Notification_pb; + blankNotif.setText("Nothing new here"); + let blankNotifList = this.state.notifications; + blankNotifList[0] = blankNotif; + this.setState({ + notifications:blankNotifList + }); + } + else this.setState({ notifications: notifs.getNotificationsList() }); @@ -412,7 +423,6 @@ export class Main extends React.Component { //and hence react's history wont be changing ie //pushing to path in App cannot be retrieved by Route exact path //because the history for react will not have those changes reflected - if (!this.state.isMarketOpen) { $("#market-close-modal").modal({ closable:false, diff --git a/public/src/components/common/TinyNetworth.tsx b/public/src/components/common/TinyNetworth.tsx index 15002e0..cf34394 100644 --- a/public/src/components/common/TinyNetworth.tsx +++ b/public/src/components/common/TinyNetworth.tsx @@ -22,6 +22,7 @@ export class TinyNetworth extends React.Component { render() { const stockWorth = this.props.userTotal - this.props.userCash; const stockWorthClass = stockWorth >= 0 ? "green" : "red"; + const netWorthClass = this.props.userTotal >= 0 ? "green" : "red"; const connection = this.props.connectionStatus == true ? "Connected" : "Disconnected"; const connectionStatusClass = this.props.connectionStatus == true ? "green" : "red"; return ( @@ -45,7 +46,7 @@ export class TinyNetworth extends React.Component {
-

+

{addCommas(this.props.userTotal)}

diff --git a/public/src/components/trading_terminal/PlaceOrderBox.tsx b/public/src/components/trading_terminal/PlaceOrderBox.tsx index e672957..3feea85 100644 --- a/public/src/components/trading_terminal/PlaceOrderBox.tsx +++ b/public/src/components/trading_terminal/PlaceOrderBox.tsx @@ -125,7 +125,7 @@ export class PlaceOrderBox extends React.Component { Stoploss

Place Order

-
+
BUY SELL @@ -153,7 +153,7 @@ export class PlaceOrderBox extends React.Component {
-
+