Enhancement: support another ghostfolio breaking change

This commit is contained in:
shamoon 2024-09-12 13:16:25 -07:00
parent 9243187490
commit 0bca24626e

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", {