From f5836c18d281d2445e553c45b487b46f3f793e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Tue, 29 Oct 2024 13:42:20 +0000 Subject: [PATCH] fix: Update publishing details on flow change --- .../components/Sidebar/Publish/PublishFlowButton.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Publish/PublishFlowButton.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Publish/PublishFlowButton.tsx index 90fa7c759e..a90bf41c48 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Publish/PublishFlowButton.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Publish/PublishFlowButton.tsx @@ -96,14 +96,14 @@ export const PublishFlowButton: React.FC<{ previewURL: string }> = ({ const user = await lastPublisher(flowId); setLastPublishedTitle(formatLastPublishMessage(date, user)); - }); + }, [flowId]); const _validateAndDiffRequest = useAsync(async () => { const newChanges = await validateAndDiffFlow(flowId); setAlteredNodes( newChanges?.data.alteredNodes ? newChanges.data.alteredNodes : [], ); - }); + }, [flowId]); // useStore.getState().getTeam().slug undefined here, use window instead const teamSlug = window.location.pathname.split("/")[1];