fix(sdk-js): handle threadId: undefined as controlled

This commit is contained in:
Tat Dat Duong
2025-03-05 00:20:59 +01:00
parent 815a67ef55
commit e466c2c90c
+2 -2
View File
@@ -366,11 +366,11 @@ const useControllableThreadId = (options?: {
onThreadIdRef.current?.(threadId);
}, []);
if (typeof options?.threadId === "undefined") {
if (!options || !("threadId" in options)) {
return [localThreadId, onThreadId];
}
return [options.threadId, onThreadId];
return [options.threadId ?? null, onThreadId];
};
type BagTemplate = {