mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-06 02:47:54 +00:00
bugfix: physics persisted sometimes after slideshow ends. now explicitly stopping physics after slideshow ends
This commit is contained in:
parent
ccef366625
commit
b86785d5c8
1 changed files with 3 additions and 0 deletions
|
|
@ -578,6 +578,8 @@ export const MemoryGraph = ({
|
|||
if (!isSlideshowActive) {
|
||||
// Close the popover when stopping slideshow
|
||||
setSelectedNode(null)
|
||||
// Explicitly cool down physics simulation in case timeout hasn't fired yet
|
||||
forceSimulation.coolDown()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -622,6 +624,7 @@ export const MemoryGraph = ({
|
|||
clearTimeout(physicsTimeoutRef.current)
|
||||
}
|
||||
physicsTimeoutRef.current = setTimeout(() => {
|
||||
// Only cool down if slideshow is still active or if this is cleanup
|
||||
forceSimulationRef.current.coolDown()
|
||||
physicsTimeoutRef.current = null
|
||||
}, 1000)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue