Fix pipeline performance issue (#1070)

This commit is contained in:
Charles Bochet 2023-08-03 16:47:30 -07:00 committed by GitHub
parent 43f20ebf74
commit 207d7b6b10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -162,10 +162,16 @@ export function HooksCompanyBoard({
); );
const synchronizeCompanyProgresses = useRecoilCallback( const synchronizeCompanyProgresses = useRecoilCallback(
({ set }) => ({ snapshot, set }) =>
(companyBoardIndex: { [key: string]: CompanyProgress }) => { (companyBoardIndex: { [key: string]: CompanyProgress }) => {
Object.entries(companyBoardIndex).forEach(([id, companyProgress]) => { Object.entries(companyBoardIndex).forEach(([id, companyProgress]) => {
if (
JSON.stringify(
snapshot.getLoadable(companyProgressesFamilyState(id)).getValue(),
) !== JSON.stringify(companyProgress)
) {
set(companyProgressesFamilyState(id), companyProgress); set(companyProgressesFamilyState(id), companyProgress);
}
}); });
}, },
[], [],