Enhancement: support another ghostfolio breaking API change (#3987)

This commit is contained in:
shamoon 2024-09-12 13:19:18 -07:00 committed by GitHub
parent 295c6ea796
commit 1eb6ac6d90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,9 @@ import useWidgetAPI from "utils/proxy/use-widget-api";
function getPerformancePercent(t, performanceRange) {
// ghostfolio v2.79.0 changed to grossPerformancePercentage
// ghostfolio v2.106.0 changed to netPerformancePercentageWithCurrencyEffect
const percent =
performanceRange.performance.netPerformancePercentageWithCurrencyEffect ??
performanceRange.performance.grossPerformancePercentage ??
performanceRange.performance.currentGrossPerformancePercent;
return `${percent > 0 ? "+" : ""}${t("common.percent", {