mirror of
https://git.mirrors.martin98.com/https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-08-06 00:06:09 +08:00
Merge pull request #6033 from lvguanjun/fix_fork_session
Some checks failed
Run Tests / test (push) Failing after 2m52s
Upstream Sync / Sync latest commits from upstream repo (push) Has been skipped
Some checks failed
Run Tests / test (push) Failing after 2m52s
Upstream Sync / Sync latest commits from upstream repo (push) Has been skipped
fix: prevent message sync between forked sessions by generating unique IDs
This commit is contained in:
commit
4ac27fdd4d
@ -214,7 +214,11 @@ export const useChatStore = createPersistStore(
|
||||
const newSession = createEmptySession();
|
||||
|
||||
newSession.topic = currentSession.topic;
|
||||
newSession.messages = [...currentSession.messages];
|
||||
// 深拷贝消息
|
||||
newSession.messages = currentSession.messages.map(msg => ({
|
||||
...msg,
|
||||
id: nanoid(), // 生成新的消息 ID
|
||||
}));
|
||||
newSession.mask = {
|
||||
...currentSession.mask,
|
||||
modelConfig: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user