fix(ui): metadata reload on project config
This commit is contained in:
parent
114bd4080b
commit
256c065153
2 changed files with 13 additions and 3 deletions
|
|
@ -16,7 +16,7 @@ function ProjectCaptureRate(props: Props) {
|
|||
const [conditions, setConditions] = React.useState<Conditions[]>([]);
|
||||
const { projectId, platform } = props.project;
|
||||
const isMobile = platform !== 'web';
|
||||
const { settingsStore, userStore } = useStore();
|
||||
const { settingsStore, userStore, customFieldStore } = useStore();
|
||||
const isAdmin = userStore.account.admin || userStore.account.superAdmin;
|
||||
const isEnterprise = userStore.isEnterprise;
|
||||
const [changed, setChanged] = useState(false);
|
||||
|
|
@ -36,7 +36,13 @@ function ProjectCaptureRate(props: Props) {
|
|||
useEffect(() => {
|
||||
if (projectId) {
|
||||
setChanged(false);
|
||||
void fetchCaptureConditions(projectId);
|
||||
const fetchData = async () => {
|
||||
if (isEnterprise) {
|
||||
await customFieldStore.fetchListActive(projectId + '');
|
||||
}
|
||||
void fetchCaptureConditions(projectId);
|
||||
};
|
||||
void fetchData();
|
||||
}
|
||||
}, [projectId]);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import ProjectForm from 'Components/Client/Projects/ProjectForm';
|
|||
import Project from '@/mstore/types/project';
|
||||
|
||||
function Projects() {
|
||||
const { projectsStore } = useStore();
|
||||
const { projectsStore, customFieldStore } = useStore();
|
||||
const history = useHistory();
|
||||
const { project, pid, tab } = projectsStore.config;
|
||||
const { openModal, closeModal } = useModal();
|
||||
|
|
@ -23,6 +23,10 @@ function Projects() {
|
|||
const tab = params.get('tab');
|
||||
projectsStore.setConfigProject(pid ? parseInt(pid) : undefined);
|
||||
projectsStore.setConfigTab(tab);
|
||||
|
||||
return () => {
|
||||
void customFieldStore.fetchListActive(projectsStore.activeSiteId + '');
|
||||
}
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue