Skip to content

Commit

Permalink
add total profit info to flipper
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-luger committed Dec 23, 2024
1 parent c1bb778 commit ceca30c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/Flipper/Flipper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ let missedInfo: FreeFlipperMissInformation = {
estimatedProfitCopiedAuctions: 0,
missedEstimatedProfit: 0,
missedFlipsCount: 0,
totalFlips: 0
totalFlips: 0,
totalProfit: 0
}

let mounted = true
Expand Down Expand Up @@ -314,7 +315,8 @@ function Flipper(props: Props) {
estimatedProfitCopiedAuctions: missedInfo.estimatedProfitCopiedAuctions,
missedEstimatedProfit: newFlipAuction.sold ? missedInfo.missedEstimatedProfit + newFlipAuction.profit : missedInfo.missedEstimatedProfit,
missedFlipsCount: newFlipAuction.sold ? missedInfo.missedFlipsCount + 1 : missedInfo.missedFlipsCount,
totalFlips: missedInfo.totalFlips + 1
totalFlips: missedInfo.totalFlips + 1,
totalProfit: missedInfo.totalProfit + newFlipAuction.profit
}

setFlips(flips => {
Expand Down Expand Up @@ -726,6 +728,9 @@ function Flipper(props: Props) {
<li>
Total flips received: <Number number={missedInfo.totalFlips} />
</li>
<li>
Total found profit: <Number number={missedInfo.totalProfit} /> Coins
</li>
<li>
Profit of copied flips: <Number number={missedInfo.estimatedProfitCopiedAuctions} /> Coins
</li>
Expand Down
1 change: 1 addition & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ interface FreeFlipperMissInformation {
missedFlipsCount: number
missedEstimatedProfit: number
estimatedProfitCopiedAuctions: number
totalProfit: number
}

interface AccountInfo {
Expand Down

0 comments on commit ceca30c

Please sign in to comment.