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];