mirror of
https://github.com/penpot/penpot.git
synced 2026-09-23 04:16:13 +00:00
Replace `globals/document` and `globals/window` with `js/document` and `js/window` in workspace.cljs, removing the unused `app.util.globals` import. This avoids "can't access dead object" errors in Firefox when navigating between pages/files, matching the existing pattern used in viewport/hooks.cljs. Fix a leaked MOUSELEAVE listener in viewport_ref.cljs — the ref callback added a new listener on every mount but never unregistered the previous one. Now uses standard .addEventListener/.removeEventListener with a React ref to track the handler for proper cleanup. Fix ResizeObserver cleanup in viewport_ref.cljs — `init-observer` is now a private function that only creates an observer when a node is provided, and cleanup is handled via the ref callback on unmount. AI-assisted-by: mimo-v2.5-pro