Enable negative growth in WooCommerce delta

[MAILPOET-5405]
This commit is contained in:
David Remer
2023-07-20 14:07:46 +03:00
committed by Veljko V
parent 0aaf0f335e
commit 1c56c3d87b

View File

@@ -80,7 +80,8 @@ function getWooCommerceDelta(type: 'revenue' | 'orders'): number | undefined {
return 0;
}
return (newValue / previous) * 100;
const delta = (newValue / previous) * 100;
return current > previous ? delta : delta * -1;
}
export function Overview(): JSX.Element | null {