From c2c2d2b40f6d21bf4ae146485c335f36039f44a0 Mon Sep 17 00:00:00 2001 From: Nick Grosenbacher Date: Thu, 22 Feb 2024 14:25:05 -0500 Subject: [PATCH] SWC-6668 - Set `staleTime` for SqlDefinedTableEditorModal --- .../SqlDefinedTableEditor/SqlDefinedTableEditorModal.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/synapse-react-client/src/components/SqlDefinedTableEditor/SqlDefinedTableEditorModal.tsx b/packages/synapse-react-client/src/components/SqlDefinedTableEditor/SqlDefinedTableEditorModal.tsx index 4b601e298f..a7af76bc58 100644 --- a/packages/synapse-react-client/src/components/SqlDefinedTableEditor/SqlDefinedTableEditorModal.tsx +++ b/packages/synapse-react-client/src/components/SqlDefinedTableEditor/SqlDefinedTableEditorModal.tsx @@ -21,7 +21,10 @@ export default function SqlDefinedTableEditorModal( data: entity, isLoading: isEntityLoading, error: entityError, - } = useGetEntity(entityId) + } = useGetEntity(entityId, undefined, { + // Set the stale time to infinity because we don't want to refetch this in the middle of an edit + staleTime: Infinity, + }) const [sql, setSql] = useState('') useEffect(() => {