From d6ec0a3406c3e6c2d278ea5d10312b1dc2b4b1bc Mon Sep 17 00:00:00 2001 From: Nuwan Date: Sat, 3 Jan 2026 10:25:25 +0530 Subject: [PATCH] __Problem__: `window.jamClient = jamClient;` was polluting the global scope, preventing garbage collection of the jamClient object and creating potential memory leaks. __Solution__: Removed the global assignment entirely since: - The `jamClient` is already available through `JamServerContext` - No usage of `window.jamClient` was found in the codebase - The comment mentioned "iframe access" but this can be handled through proper React patterns if needed --- jam-ui/src/components/client/JKSessionScreen.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/jam-ui/src/components/client/JKSessionScreen.js b/jam-ui/src/components/client/JKSessionScreen.js index cb34f940e..b5347a52e 100644 --- a/jam-ui/src/components/client/JKSessionScreen.js +++ b/jam-ui/src/components/client/JKSessionScreen.js @@ -155,9 +155,6 @@ const JKSessionScreen = () => { if (!isConnected || !jamClient) return; console.debug("JKSessionScreen: -DEBUG- isConnected changed to true"); - // Make jamClient available globally for iframe access - window.jamClient = jamClient; - guardOnJoinSession(); }, [isConnected, jamClient]); // Added jamClient to dependencies for stability