diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 7ced4b2c4f..cef3e3d586 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -3290,7 +3290,10 @@ sanitizeHistory(history); chatTitle.set(chatContent.title); - branchPointMessageId = parentChatId ? (chatContent.branchPointMessageId ?? null) : null; + branchPointMessageId = + chatContent.originalChatId === parentChatId + ? (chatContent.branchPointMessageId ?? null) + : null; if (side) await onEmbeddedChatTitle?.(id, chatContent.title); params = structuredClone(chatContent?.params ?? {}); @@ -4148,6 +4151,9 @@ if (!embedded) { await goto(`/c/${result.id}`); await refreshChatList(localStorage.token, { refreshPinned: true }); + } else if (side) { + await onSelectEmbeddedChat?.(result.id); + await refreshChatList(localStorage.token, { refreshPinned: true }); } toast.success($i18n.t('Chat forked'), { id: toastId }); } else {