fix lint errors

This commit is contained in:
Maximilian Schneider 2021-06-16 12:17:16 -04:00
parent d31eb4b119
commit 6c4507cfc6
3 changed files with 27 additions and 29 deletions

View File

@ -61,17 +61,16 @@ export default function MarginInfo() {
const selectedMangoGroup = useMangoStore((s) => s.selectedMangoGroup.current)
const tradeHistory = useTradeHistory()
const tradeHistoryLength = useMemo(() => tradeHistory.length, [tradeHistory])
const [mAccountInfo, setMAccountInfo] =
useState<
| {
label: string
value: string
unit: string
desc: string
currency: string
}[]
| null
>(null)
const [mAccountInfo, setMAccountInfo] = useState<
| {
label: string
value: string
unit: string
desc: string
currency: string
}[]
| null
>(null)
const [openAlertModal, setOpenAlertModal] = useState(false)
useEffect(() => {

View File

@ -25,8 +25,8 @@ export default function StatsTotals() {
)
// get deposit and borrow values from stats
let depositValues = []
let borrowValues = []
const depositValues = []
const borrowValues = []
if (prices) {
for (let i = 0; i < trimmedStats.length; i++) {
const depositValue =
@ -70,19 +70,19 @@ export default function StatsTotals() {
}, [])
// sum the values for each hour
let holder = {}
const holder = {}
hours.forEach(function (d) {
if (holder.hasOwnProperty(d.time)) {
if (d.time in holder) {
holder[d.time] = holder[d.time] + d.value
} else {
holder[d.time] = d.value
}
})
let points = []
const points = []
for (let prop in holder) {
for (const prop in holder) {
points.push({ time: prop, value: holder[prop] })
}
return points

View File

@ -62,18 +62,17 @@ const useMarginInfo = () => {
)
const tradeHistory = useTradeHistory()
const tradeHistoryLength = useMemo(() => tradeHistory.length, [tradeHistory])
const [mAccountInfo, setMAccountInfo] =
useState<
| {
label: string
value: string
unit: string
desc: string
currency: string
icon: ReactNode
}[]
| null
>(null)
const [mAccountInfo, setMAccountInfo] = useState<
| {
label: string
value: string
unit: string
desc: string
currency: string
icon: ReactNode
}[]
| null
>(null)
useEffect(() => {
if (selectedMangoGroup) {