From 054bb0dc04e921a79cab4cc2f0e00a07d2993b17 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Wed, 16 Dec 2020 09:36:42 +0000 Subject: [PATCH] removed test entry, sending close event on button --- websrc/components/Tables.tsx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/websrc/components/Tables.tsx b/websrc/components/Tables.tsx index fe1cdd8..c4b9640 100644 --- a/websrc/components/Tables.tsx +++ b/websrc/components/Tables.tsx @@ -1,6 +1,6 @@ import React, {Component} from "react" import {Badge, Button, Container, Table} from "react-bootstrap" -import {PositionState} from '../'; +import {NewTickData, PositionState, socket} from '../'; export class PositionTable extends Component<{}, { positions: Array }> { @@ -14,7 +14,7 @@ export class PositionTable extends Component<{}, { positions: Array { + this.setState({ + positions: data.positions + }) }) - - // socket.on('new_tick', (data: NewTickData) => { - // this.setState({ - // positions: [...this.state.positions, data.positions] - // }) - // }) } tableData() { @@ -65,7 +61,9 @@ export class PositionTable extends Component<{}, { positions: Array{position.base_price.toFixed(2)} {position.profit_loss.toFixed(2)} {position.profit_loss_percentage.toFixed(2)} % - + ) }) }