Skip to content

Commit bf3213e

Browse files
committed
only call getItemCounts in workflows inline-mode, when the list of pinboardIds actually changes
1 parent e7a5063 commit bf3213e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/src/inline/inlineMode.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const InlineMode = ({
5656
() => getWorkflowTitleElementLookup(workflowPinboardElements),
5757
[workflowPinboardElements]
5858
);
59+
const pinboardIds = Object.keys(workflowTitleElementLookup);
5960

6061
const [itemCountsLookup, setItemCountsLookup] = useState<
6162
Record<string, PinboardIdWithItemCounts>
@@ -64,7 +65,6 @@ export const InlineMode = ({
6465
const [fetchItemCounts] = useLazyQuery(gqlGetItemCounts);
6566

6667
useEffect(() => {
67-
const pinboardIds = Object.keys(workflowTitleElementLookup);
6868
if (pinboardIds.length > 0) {
6969
fetchItemCounts({
7070
variables: { pinboardIds },
@@ -86,7 +86,7 @@ export const InlineMode = ({
8686
});
8787
}
8888
}, [
89-
workflowTitleElementLookup,
89+
pinboardIds.toString(),
9090
totalItemsReceivedViaSubscription,
9191
totalOfMyOwnOnSeenItemsReceivedViaSubscription,
9292
]);

0 commit comments

Comments
 (0)