From b6bcf00e089f6f14f59a031ab0139b5420df9bdd Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Tue, 15 Feb 2022 16:24:35 -0300 Subject: [PATCH] 18315: Only limit the fetchData() call on PDH changes. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- .../collection-panel-files/collection-panel-files.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/collection-panel-files/collection-panel-files.tsx b/src/components/collection-panel-files/collection-panel-files.tsx index 459d9d20..1ee6df30 100644 --- a/src/components/collection-panel-files/collection-panel-files.tsx +++ b/src/components/collection-panel-files/collection-panel-files.tsx @@ -278,13 +278,12 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState } }, [rightKey]); // eslint-disable-line react-hooks/exhaustive-deps + const currentPDH = (collectionPanel.item || {}).portableDataHash; React.useEffect(() => { - const hash = (collectionPanel.item || {}).portableDataHash; - - if (hash && collectionAutofetchEnabled) { + if (currentPDH) { fetchData([leftKey, rightKey], true); } - }, [(collectionPanel.item || {}).portableDataHash]); // eslint-disable-line react-hooks/exhaustive-deps + }, [currentPDH]); // eslint-disable-line react-hooks/exhaustive-deps React.useEffect(() => { if (rightData) { -- 2.39.5