- fixed login for confidi users;
- restyled fileselect UI;
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user