Fix Cytoscape.js crash on navigation away from network map

- Stop running layout before destroy to prevent async callbacks hitting null renderer
- Set wheelSensitivity to 1 (default) to suppress console warning
This commit is contained in:
Graham McIntire 2026-02-14 14:53:02 -06:00
parent 29c2039832
commit b1438204df

View file

@ -588,6 +588,11 @@ const NetworkMap = {
destroyed(this: any) {
if (this.cy) {
// Stop any running layout before destroying to prevent async callbacks
// from accessing a destroyed renderer
try {
this.cy.stop()
} catch (_e) { /* ignore */ }
this.cy.destroy()
this.cy = null
}
@ -803,7 +808,7 @@ const NetworkMap = {
},
minZoom: 0.2,
maxZoom: 3,
wheelSensitivity: 0.2
wheelSensitivity: 1
})
// Add click handler for nodes