- fixed login for confidi users;
- restyled fileselect UI;
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { is, uniq } from 'ramda';
|
||||
import { head, is, uniq } from 'ramda';
|
||||
|
||||
// store
|
||||
import { useStore } from '../../../../store';
|
||||
@@ -26,13 +26,16 @@ import { confirmPopup, ConfirmPopup } from 'primereact/confirmpopup';
|
||||
|
||||
const DocumentsTable = ({ type, reload = 0 }) => {
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
const companies = useStore().main.companies();
|
||||
const [docs, setDocs] = useState([]);
|
||||
const [filters, setFilters] = useState(null);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [statuses, setStatuses] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!loading && chosenCompanyId && chosenCompanyId !== 0 && reload !== 0) {
|
||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||
|
||||
if (!loading && existingCompany && reload !== 0) {
|
||||
setLoading(true);
|
||||
CompanyDocumentsService.getCompanyDocuments(chosenCompanyId, getCallback, errGetCallbacks, [
|
||||
['documentType', type]
|
||||
@@ -41,10 +44,14 @@ const DocumentsTable = ({ type, reload = 0 }) => {
|
||||
}, [chosenCompanyId, reload]);
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
CompanyDocumentsService.getCompanyDocuments(chosenCompanyId, getCallback, errGetCallbacks, [
|
||||
['documentType', type]
|
||||
]);
|
||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||
|
||||
if (existingCompany) {
|
||||
setLoading(true);
|
||||
CompanyDocumentsService.getCompanyDocuments(chosenCompanyId, getCallback, errGetCallbacks, [
|
||||
['documentType', type]
|
||||
]);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const getCallback = (resp) => {
|
||||
|
||||
Reference in New Issue
Block a user