mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: success rate in the stats page
This commit is contained in:
@@ -18,10 +18,8 @@ export default function StatisticsPage() {
|
||||
getStatistics().then(setStats)
|
||||
}, [])
|
||||
|
||||
const totalDomainPurchase = (stats?.domainPurchased ?? 0) + (stats?.domainPurchaseFailed ?? 0)
|
||||
|
||||
const successRate = stats !== undefined
|
||||
? (totalDomainPurchase === 0 ? undefined : stats.domainPurchased / totalDomainPurchase)
|
||||
? (stats?.domainPurchased === 0 ? undefined : ((stats?.domainPurchased ?? 0) - (stats?.domainPurchaseFailed ?? 0)) / stats?.domainPurchased)
|
||||
: undefined
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user