mito-ds / mito

The mitosheet package, trymito.io, and other public Mito code.
https://trymito.io
Other
2.3k stars 160 forks source link

Fix bug when opening graph editor then pressing undo #1283

Closed marthacryan closed 8 months ago

marthacryan commented 8 months ago

Fixes #1092. The issue describes a different bug (which I assume was fixed somewhere?) but in trying to reproduce it I caught a different bug. The bug I saw was that pressing undo would get rid of the graph, but not close the graph editor. There would be no graph, but because the graph editor is designed to create a new graph when it sees the graph editor is open, it would just create a new graph. I chose to solve this by adding a useEffect that would check in the Mito component when the graphDataArray changed, and if the graphDataArray was empty but the graph taskpane was open, it just closes that taskpane.

vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
monorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2024 11:01pm