Skip to content

Commit

Permalink
Merge pull request #38 from supabase-community/fix/graph-viewport-ini…
Browse files Browse the repository at this point in the history
…tial-animation

fix: initial animation on graph viewport
  • Loading branch information
gregnr authored Aug 10, 2024
2 parents 0fdbcb8 + 3d633bc commit 1d55862
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/postgres-new/components/schema/table-graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ export default function TablesGraph({

// `fitView` needs to happen during next event tick
setTimeout(() => fitView(isFirstLoad ? 0 : 500), 0)
setIsFirstLoad(false)

if (tables.length > 0) {
setIsFirstLoad(false)
}
})
}
}, [reactFlowInstance, tables, resolvedTheme, fitView, isFirstLoad])
Expand Down

0 comments on commit 1d55862

Please sign in to comment.