@droppii-org/chat-sdk 0.6.20 → 0.6.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"useActiveConversation.d.ts","sourceRoot":"","sources":["../../../src/hooks/conversation/useActiveConversation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,eAAO,MAAM,qBAAqB,GAChC,mBAAmB,oBAAoB,EAAE,SAqF1C,CAAC"}
1
+ {"version":3,"file":"useActiveConversation.d.ts","sourceRoot":"","sources":["../../../src/hooks/conversation/useActiveConversation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,eAAO,MAAM,qBAAqB,GAChC,mBAAmB,oBAAoB,EAAE,SA2F1C,CAAC"}
@@ -11,15 +11,19 @@ export const useActiveConversation = (conversationItems) => {
11
11
  const setSearchClientMsgID = useConversationStore((state) => state.setSearchClientMsgID);
12
12
  const appliedMessageTargetRef = useRef(null);
13
13
  useEffect(() => {
14
- var _a;
15
14
  const params = typeof window !== "undefined"
16
15
  ? new URLSearchParams(window.location.search)
17
16
  : null;
18
- const threadId = (_a = params === null || params === void 0 ? void 0 : params.get("threadId")) !== null && _a !== void 0 ? _a : null;
17
+ // `conversationId` is an accepted alias for `threadId` (external deep
18
+ // links use it). Both names must be read here: this effect re-runs on
19
+ // every conversationItems mutation, so knowing only one of them means the
20
+ // other gets cleared away again the moment the list finishes loading.
21
+ const threadId = (params === null || params === void 0 ? void 0 : params.get("threadId")) || (params === null || params === void 0 ? void 0 : params.get("conversationId")) || null;
19
22
  if (!threadId) {
20
23
  const hasPendingTarget = !!((params === null || params === void 0 ? void 0 : params.get("userId")) ||
21
24
  (params === null || params === void 0 ? void 0 : params.get("groupId")) ||
22
- (params === null || params === void 0 ? void 0 : params.get("botId")));
25
+ (params === null || params === void 0 ? void 0 : params.get("botId")) ||
26
+ (params === null || params === void 0 ? void 0 : params.get("inviteToken")));
23
27
  if (hasPendingTarget)
24
28
  return;
25
29
  appliedMessageTargetRef.current = null;
@@ -4,9 +4,10 @@ export interface UseResolveConversationParams {
4
4
  userId?: string;
5
5
  groupId?: string;
6
6
  botId?: string;
7
+ messageId?: string;
7
8
  }
8
9
  export declare const fetchConversationByBotId: (botId: string) => Promise<ConversationItem | null>;
9
- export declare const useResolveConversation: ({ conversationId, userId, groupId, botId, }: UseResolveConversationParams) => {
10
+ export declare const useResolveConversation: ({ conversationId, userId, groupId, botId, messageId, }: UseResolveConversationParams) => {
10
11
  isResolving: boolean;
11
12
  error: Error | null;
12
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useResolveConversation.d.ts","sourceRoot":"","sources":["../../../src/hooks/conversation/useResolveConversation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAe,MAAM,8BAA8B,CAAC;AAU7E,MAAM,WAAW,4BAA4B;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA2BD,eAAO,MAAM,wBAAwB,GACnC,OAAO,MAAM,KACZ,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAWjC,CAAC;AAqCF,eAAO,MAAM,sBAAsB,GAAI,6CAKpC,4BAA4B;;;CA2H9B,CAAC"}
1
+ {"version":3,"file":"useResolveConversation.d.ts","sourceRoot":"","sources":["../../../src/hooks/conversation/useResolveConversation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAe,MAAM,8BAA8B,CAAC;AAU7E,MAAM,WAAW,4BAA4B;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2BD,eAAO,MAAM,wBAAwB,GACnC,OAAO,MAAM,KACZ,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAWjC,CAAC;AAwCF,eAAO,MAAM,sBAAsB,GAAI,wDAMpC,4BAA4B;;;CA4H9B,CAAC"}
@@ -48,8 +48,8 @@ const matchesTarget = (conversation, { conversationId, userId, groupId, botId })
48
48
  (!!groupId && conversation.groupID === groupId) ||
49
49
  (!!botId && resolveConversationBotId(conversation) === botId));
50
50
  };
51
- const targetKey = ({ conversationId, userId, groupId, botId, }) => `${conversationId !== null && conversationId !== void 0 ? conversationId : ""}|${userId !== null && userId !== void 0 ? userId : ""}|${groupId !== null && groupId !== void 0 ? groupId : ""}|${botId !== null && botId !== void 0 ? botId : ""}`;
52
- export const useResolveConversation = ({ conversationId, userId, groupId, botId, }) => {
51
+ const targetKey = ({ conversationId, userId, groupId, botId, messageId, }) => `${conversationId !== null && conversationId !== void 0 ? conversationId : ""}|${userId !== null && userId !== void 0 ? userId : ""}|${groupId !== null && groupId !== void 0 ? groupId : ""}|${botId !== null && botId !== void 0 ? botId : ""}|${messageId !== null && messageId !== void 0 ? messageId : ""}`;
52
+ export const useResolveConversation = ({ conversationId, userId, groupId, botId, messageId, }) => {
53
53
  const [isFetching, setIsFetching] = useState(false);
54
54
  const [error, setError] = useState(null);
55
55
  // A target the store rejected (no access) clears conversationData back to
@@ -123,7 +123,9 @@ export const useResolveConversation = ({ conversationId, userId, groupId, botId,
123
123
  key: currentTargetKey,
124
124
  conversationID: resolved.conversationID,
125
125
  };
126
- setConversationData(resolved, undefined, { forceRevalidate: true });
126
+ setConversationData(resolved, messageId || undefined, {
127
+ forceRevalidate: true,
128
+ });
127
129
  setSelectedConversationId(resolved.conversationID);
128
130
  }
129
131
  catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"useGroupInviteLink.d.ts","sourceRoot":"","sources":["../../../src/hooks/group/useGroupInviteLink.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,qBAAqB,GAC7B,MAAM,GACN,SAAS,GACT,aAAa,GACb,SAAS,GACT,OAAO,CAAC;AAEZ,UAAU,wBAAwB;IAChC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAC7B,cAAc,MAAM,KACnB,wBAuDF,CAAC"}
1
+ {"version":3,"file":"useGroupInviteLink.d.ts","sourceRoot":"","sources":["../../../src/hooks/group/useGroupInviteLink.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,qBAAqB,GAC7B,MAAM,GACN,SAAS,GACT,aAAa,GACb,SAAS,GACT,OAAO,CAAC;AAEZ,UAAU,wBAAwB;IAChC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAC7B,cAAc,MAAM,KACnB,wBAyDF,CAAC"}
@@ -27,6 +27,8 @@ export const useGroupInviteLink = (inviteToken) => {
27
27
  queryKey: [QUERY_KEYS.GET_JOIN_LINK_INFO, inviteToken],
28
28
  enabled: Boolean(inviteToken) && !dismissed,
29
29
  queryFn: () => getJoinLinkInfo(inviteToken),
30
+ refetchOnWindowFocus: false,
31
+ refetchOnReconnect: false,
30
32
  });
31
33
  const { mutateAsync: joinGroupByLink, isPending: isJoining } = useJoinGroupByLink();
32
34
  const confirmJoin = useCallback(() => {
@@ -10,6 +10,6 @@ export interface DChatConversationDetailProps extends ConversationDetailInputPro
10
10
  */
11
11
  onCopyMessageLink?: (conversationId: string, clientMsgID: string) => void;
12
12
  }
13
- declare const DChatConversationDetail: ({ className, children, onBack, conversationId, userId, groupId, botId, onCopyMessageLink, ...inputProps }: DChatConversationDetailProps) => import("react/jsx-runtime").JSX.Element | null;
13
+ declare const DChatConversationDetail: ({ className, children, onBack, conversationId, messageId, userId, groupId, botId, onCopyMessageLink, ...inputProps }: DChatConversationDetailProps) => import("react/jsx-runtime").JSX.Element | null;
14
14
  export default DChatConversationDetail;
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation-detail/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAWrF,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,6CAA6C,CAAC;AAGrD,MAAM,WAAW,4BACf,SAAQ,4BAA4B,EACpC,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3E;AAED,QAAA,MAAM,uBAAuB,GAAI,2GAY9B,4BAA4B,mDAyN9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation-detail/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAWrF,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,6CAA6C,CAAC;AAGrD,MAAM,WAAW,4BACf,SAAQ,4BAA4B,EAClC,4BAA4B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3E;AAED,QAAA,MAAM,uBAAuB,GAAI,sHAa9B,4BAA4B,mDAoO9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -31,10 +31,10 @@ import { useResolveConversation, } from "../../hooks/conversation/useResolveConv
31
31
  import { isBotPeer } from "../../utils/conversation";
32
32
  const DChatConversationDetail = (_a) => {
33
33
  var _b;
34
- var { className, children, onBack, conversationId, userId, groupId, botId,
34
+ var { className, children, onBack, conversationId, messageId, userId, groupId, botId,
35
35
  // Destructured out of the rest spread on purpose: everything left in
36
36
  // inputProps goes to ConversationDetailInput, which has no business with it.
37
- onCopyMessageLink } = _a, inputProps = __rest(_a, ["className", "children", "onBack", "conversationId", "userId", "groupId", "botId", "onCopyMessageLink"]);
37
+ onCopyMessageLink } = _a, inputProps = __rest(_a, ["className", "children", "onBack", "conversationId", "messageId", "userId", "groupId", "botId", "onCopyMessageLink"]);
38
38
  const { t } = useTranslation("conversation-inbox");
39
39
  const { useUrlState = true } = useChatContext();
40
40
  const onNavigate = useChatNavigate();
@@ -47,6 +47,7 @@ const DChatConversationDetail = (_a) => {
47
47
  userId,
48
48
  groupId,
49
49
  botId,
50
+ messageId,
50
51
  });
51
52
  const isBotThread = conversation ? isBotPeer(conversation) : false;
52
53
  const botFlow = useBotFlow({
@@ -67,20 +68,32 @@ const DChatConversationDetail = (_a) => {
67
68
  onBack === null || onBack === void 0 ? void 0 : onBack();
68
69
  return;
69
70
  }
70
- if (typeof window !== "undefined" && window.history.length > 1) {
71
- window.history.back();
71
+ // if (typeof window !== "undefined" && window.history.length > 1) {
72
+ // window.history.back();
73
+ // onBack?.();
74
+ // return;
75
+ // }
76
+ try {
77
+ const newSearchParams = new URLSearchParams(window.location.search);
78
+ newSearchParams.delete("threadId");
79
+ newSearchParams.delete("userId");
80
+ newSearchParams.delete("groupId");
81
+ newSearchParams.delete("botId");
82
+ newSearchParams.delete("conversationId");
83
+ newSearchParams.delete("inviteToken");
84
+ newSearchParams.delete("messageId");
85
+ const query = newSearchParams.toString();
86
+ const pathname = window.location.pathname;
87
+ onNavigate(query ? `${pathname}?${query}` : pathname);
72
88
  onBack === null || onBack === void 0 ? void 0 : onBack();
73
- return;
74
89
  }
75
- const newSearchParams = new URLSearchParams(window.location.search);
76
- newSearchParams.delete("threadId");
77
- newSearchParams.delete("userId");
78
- newSearchParams.delete("groupId");
79
- newSearchParams.delete("botId");
80
- const query = newSearchParams.toString();
81
- const pathname = window.location.pathname;
82
- onNavigate(query ? `${pathname}?${query}` : pathname);
83
- onBack === null || onBack === void 0 ? void 0 : onBack();
90
+ catch (error) {
91
+ if (typeof window !== "undefined" && window.history.length > 1) {
92
+ window.history.back();
93
+ onBack === null || onBack === void 0 ? void 0 : onBack();
94
+ return;
95
+ }
96
+ }
84
97
  };
85
98
  if (isResolving) {
86
99
  return (_jsx("div", { className: "flex h-full w-full items-center justify-center bg-white", children: _jsx(Spin, {}) }));
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation-inbox/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,MAAM,WAAW,2BAA2B;IAC1C,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACjC,6FAA6F;IAC7F,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,yEAAyE;IACzE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3E;AAmND,QAAA,MAAM,sBAAsB,GAAI,OAAO,2BAA2B,4CAQjE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation-inbox/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,MAAM,WAAW,2BAA2B;IAC1C,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACjC,6FAA6F;IAC7F,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,yEAAyE;IACzE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3E;AA2ND,QAAA,MAAM,sBAAsB,GAAI,OAAO,2BAA2B,4CAQjE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -26,6 +26,9 @@ const DChatConversationInboxWithUrlTarget = (props) => {
26
26
  var _a, _b, _c, _d, _e, _f, _g, _h;
27
27
  const searchParams = useSearchParams();
28
28
  const conversationList = useInboxConversationList(props.chatCategory);
29
+ // Sole owner of the URL → store sync (threadId/conversationId + messageId).
30
+ // Do not add a second effect here that re-derives the same thing: this hook
31
+ // re-runs on every conversationItems mutation and would race with it.
29
32
  useActiveConversation(conversationList.items);
30
33
  // DROPPII-30546: ?inviteToken= resolves through useGroupInviteLink before
31
34
  // it can ever reach the normal groupId flow below — a fresh private-group
@@ -34,10 +37,13 @@ const DChatConversationInboxWithUrlTarget = (props) => {
34
37
  const inviteToken = (_a = searchParams.get("inviteToken")) !== null && _a !== void 0 ? _a : undefined;
35
38
  const inviteLink = useGroupInviteLink(inviteToken);
36
39
  const target = {
37
- threadId: (_b = searchParams.get("threadId")) !== null && _b !== void 0 ? _b : undefined,
38
- userId: (_c = searchParams.get("userId")) !== null && _c !== void 0 ? _c : undefined,
39
- groupId: (_e = (_d = inviteLink.groupId) !== null && _d !== void 0 ? _d : searchParams.get("groupId")) !== null && _e !== void 0 ? _e : undefined,
40
- botId: (_f = searchParams.get("botId")) !== null && _f !== void 0 ? _f : undefined,
40
+ threadId: searchParams.get("threadId") ||
41
+ searchParams.get("conversationId") ||
42
+ undefined,
43
+ userId: (_b = searchParams.get("userId")) !== null && _b !== void 0 ? _b : undefined,
44
+ groupId: (_d = (_c = inviteLink.groupId) !== null && _c !== void 0 ? _c : searchParams.get("groupId")) !== null && _d !== void 0 ? _d : undefined,
45
+ botId: (_e = searchParams.get("botId")) !== null && _e !== void 0 ? _e : undefined,
46
+ messageId: (_f = searchParams.get("messageId")) !== null && _f !== void 0 ? _f : undefined,
41
47
  };
42
48
  if (inviteLink.status === "loading") {
43
49
  return null;
@@ -75,7 +81,7 @@ const DChatConversationInboxBody = ({ onSelectThread, className, moreOptions, sh
75
81
  const { t } = useTranslation("conversation-inbox");
76
82
  const selectedConversationId = useConversationStore((state) => state.selectedConversationId);
77
83
  const [isSearchOpen, { setTrue: openSearch, setFalse: closeSearch }] = useBoolean(false);
78
- const { threadId, userId, groupId, botId } = target;
84
+ const { threadId, userId, groupId, botId, messageId } = target;
79
85
  // Any of the four targets opens the detail screen — useResolveConversation
80
86
  // turns userId/groupId/botId into a thread (creating the bot one when
81
87
  // missing), so entry points that only know the peer still work.
@@ -89,7 +95,7 @@ const DChatConversationInboxBody = ({ onSelectThread, className, moreOptions, sh
89
95
  groupId ||
90
96
  botId);
91
97
  if (hasConversationTarget) {
92
- return (_jsx(DChatConversationDetail, { className: className, moreOptions: moreOptions, conversationId: threadId !== null && threadId !== void 0 ? threadId : undefined, userId: userId, groupId: groupId, botId: botId, onCopyMessageLink: onCopyMessageLink }));
98
+ return (_jsx(DChatConversationDetail, { className: className, moreOptions: moreOptions, conversationId: threadId !== null && threadId !== void 0 ? threadId : undefined, userId: userId, groupId: groupId, botId: botId, onCopyMessageLink: onCopyMessageLink, messageId: messageId }));
93
99
  }
94
100
  return (_jsxs("div", { "data-testid": "conversation-inbox-root", className: clsx(
95
101
  // `relative` + `overflow-hidden` keep ContactSearchPanel's Drawer
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/store/conversation.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAY3C,eAAO,MAAM,kBAAkB,GAAI,SAAS,OAAO,SAElD,CAAC;AAEF,QAAA,MAAM,oBAAoB,gFAkYvB,CAAC;AAEJ,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/store/conversation.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAY3C,eAAO,MAAM,kBAAkB,GAAI,SAAS,OAAO,SAElD,CAAC;AAEF,QAAA,MAAM,oBAAoB,gFAuYvB,CAAC;AAEJ,eAAe,oBAAoB,CAAC"}
@@ -262,8 +262,12 @@ const useConversationStore = create((set, get) => ({
262
262
  // dependency by design: this store has no access to one.
263
263
  if (urlStateEnabled && typeof window !== "undefined") {
264
264
  const params = new URLSearchParams(window.location.search);
265
- if (params.has("threadId")) {
265
+ // `conversationId` is an accepted alias for `threadId` — leaving it
266
+ // behind would let the next effect run re-select what we just cleared.
267
+ const hadThreadParam = params.has("threadId") || params.has("conversationId");
268
+ if (hadThreadParam) {
266
269
  params.delete("threadId");
270
+ params.delete("conversationId");
267
271
  const query = params.toString();
268
272
  const url = `${window.location.pathname}${query ? `?${query}` : ""}`;
269
273
  window.history.replaceState(null, "", url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@droppii-org/chat-sdk",
3
- "version": "0.6.20",
3
+ "version": "0.6.22",
4
4
  "description": "Droppii React Chat SDK",
5
5
  "repository": {
6
6
  "type": "git",