Only notify with actual changes (#1173)

This commit is contained in:
Shuchang Zheng
2024-11-11 10:41:10 -08:00
committed by GitHub
parent b768ca0e86
commit c1c2b5ca24
2 changed files with 6 additions and 5 deletions

View File

@@ -191,7 +191,7 @@ function FlowRenderer({
const [title, setTitle] = useState(initialTitle);
const nodesInitialized = useNodesInitialized();
const { hasChanges, setHasChanges } = useWorkflowHasChangesStore();
useShouldNotifyWhenClosingTab();
useShouldNotifyWhenClosingTab(hasChanges);
const blocker = useBlocker(({ currentLocation, nextLocation }) => {
return hasChanges && nextLocation.pathname !== currentLocation.pathname;
});