From c93ddf6163cc5c893b4dd3ca1bceeb24fb5c2506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Sandvik?= Date: Thu, 6 Feb 2025 15:51:25 +0100 Subject: [PATCH] chore: optimization --- i18n/en.pot | 7 ++----- src/components/import/ImportPage.jsx | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index 7f62cdc..79ca346 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2025-02-05T10:45:16.315Z\n" -"PO-Revision-Date: 2025-02-05T10:45:16.315Z\n" +"POT-Creation-Date: 2025-02-06T14:06:33.277Z\n" +"PO-Revision-Date: 2025-02-06T14:06:33.277Z\n" msgid "About this app" msgstr "About this app" @@ -746,9 +746,6 @@ msgstr "Aggregation levels" msgid "Assign all org unit levels" msgstr "Assign all org unit levels" -msgid "Legend: \"{{name}}\"" -msgstr "Legend: \"{{name}}\"" - msgid "Start value" msgstr "Start value" diff --git a/src/components/import/ImportPage.jsx b/src/components/import/ImportPage.jsx index 1af69e7..1f36d73 100644 --- a/src/components/import/ImportPage.jsx +++ b/src/components/import/ImportPage.jsx @@ -1,7 +1,7 @@ import { useConfig } from '@dhis2/app-runtime' import i18n from '@dhis2/d2-i18n' import { Card, Button } from '@dhis2/ui' -import { useState, useEffect } from 'react' +import { useState, useMemo, useEffect } from 'react' import useOrgUnitCount from '../../hooks/useOrgUnitCount.js' import { getDefaultImportPeriod, @@ -32,7 +32,7 @@ const ImportPage = () => { const standardPeriod = getStandardPeriod(period) // ISO 8601 used by GEE const [startExtract, setStartExtract] = useState(false) const orgUnitCount = useOrgUnitCount(orgUnits?.parent?.id, orgUnits?.level) - const periodCount = getPeriods(period).length + const periodCount = useMemo(() => getPeriods(period).length, [period]) const valueCount = orgUnitCount * periodCount const periodType = periodTypes .find((type) => type.id === period.periodType)