- fixed login for confidi users;

- restyled fileselect UI;
This commit is contained in:
Vitalii Kiiko
2025-03-11 15:19:13 +01:00
parent d9aa0b6c23
commit e13e63e1ca
12 changed files with 126 additions and 56 deletions

View File

@@ -1,6 +1,6 @@
import React, { useEffect, useState, useCallback } from 'react';
import { __ } from '@wordpress/i18n';
import { isEmpty, pathOr } from 'ramda';
import { head, isEmpty, pathOr } from 'ramda';
import NumberFlow from '@number-flow/react';
// store
@@ -16,6 +16,7 @@ const StatsBeneficiary = () => {
const [mainStats, setMainStats] = useState({});
const [chartStats, setChartStats] = useState({});
const chosenCompanyId = useStore().main.chosenCompanyId();
const companies = useStore().main.companies();
const getStats = (resp) => {
if (resp.status === 'SUCCESS') {
@@ -31,7 +32,11 @@ const StatsBeneficiary = () => {
}, [mainStats]);
useEffect(() => {
DashboardService.getBeneficiaryStatsPage(chosenCompanyId, getStats, errGetStats);
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
if (existingCompany) {
DashboardService.getBeneficiaryStatsPage(chosenCompanyId, getStats, errGetStats);
}
}, [chosenCompanyId]);
return(