From dee6633cb5946af93c400a3fa6de9f8d72664032 Mon Sep 17 00:00:00 2001 From: zahlekhan Date: Tue, 6 Jan 2026 16:09:56 +0530 Subject: [PATCH 1/2] Enhance chat instance destruction logic - Prevents unnecessary operations if the chat instance is already destroyed. - Cleans up the global chat reference by deleting window.__THESYS_CHAT__. --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index 686e7cf..926a50e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -371,8 +371,10 @@ export function createChat(config: ChatConfig): ChatInstance { }, destroy: () => { + if (!container.isConnected) return; // Already destroyed root.unmount(); container.remove(); + delete window.__THESYS_CHAT__; }, getSessionId: () => currentSessionId || "", From 2008ffbe5e0352d65f082ccf4ddc50f8d193777b Mon Sep 17 00:00:00 2001 From: zahlekhan Date: Tue, 6 Jan 2026 16:10:05 +0530 Subject: [PATCH 2/2] Bump version to 0.6.2 in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5cd5ca..fd3c998 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "genui-widget", - "version": "0.6.1", + "version": "0.6.2", "type": "module", "description": "An embeddable chat widget that lets your AI chatbots render rich, interactive UI like buttons, forms, charts, cards and more instead of plain text. Works out of the box with LangGraph/LangChain and n8n.", "main": "./dist/genui-widget.umd.js",