Handle error to send to sentry.
This commit is contained in:
@@ -9,7 +9,7 @@ import type {
|
||||
Time,
|
||||
UTCTimestamp,
|
||||
} from 'lightweight-charts'
|
||||
import {LineStyle, createChart, CrosshairMode} from 'lightweight-charts'
|
||||
import {createChart, CrosshairMode, LineStyle} from 'lightweight-charts'
|
||||
import moment from 'moment'
|
||||
import * as React from 'react'
|
||||
import {useEffect, useRef, useState} from 'react'
|
||||
@@ -22,10 +22,7 @@ import type {
|
||||
StrategiesResultBase,
|
||||
StrategyType,
|
||||
} from '../../../../generated/ManagingApi'
|
||||
import {
|
||||
PositionStatus,
|
||||
TradeDirection,
|
||||
} from '../../../../generated/ManagingApi'
|
||||
import {PositionStatus, TradeDirection,} from '../../../../generated/ManagingApi'
|
||||
import useTheme from '../../../../hooks/useTheme'
|
||||
|
||||
// var customTheme = {
|
||||
@@ -143,8 +140,8 @@ const TradeChart = ({
|
||||
let color = 'mintcream'
|
||||
if (position == undefined) return color
|
||||
|
||||
const negativeColor = 'palevioletred'
|
||||
const positiveColor = 'lightgreen'
|
||||
const negativeColor = theme.error
|
||||
const positiveColor = theme.success
|
||||
const status = position.status
|
||||
const realized = position.profitAndLoss?.realized ?? 0
|
||||
|
||||
@@ -158,13 +155,11 @@ const TradeChart = ({
|
||||
} else {
|
||||
color = negativeColor
|
||||
}
|
||||
}else if (status == PositionStatus.Filled) {
|
||||
color = theme.warning
|
||||
}
|
||||
}
|
||||
|
||||
if (position.profitAndLoss?.realized == null) {
|
||||
color = 'yellow'
|
||||
}
|
||||
|
||||
return color
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user