mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	Update chat.ts
This commit is contained in:
		@@ -274,8 +274,6 @@ export const useChatStore = create<ChatStore>()(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        // save user's and bot's message
 | 
					        // save user's and bot's message
 | 
				
			||||||
        get().updateCurrentSession((session) => {
 | 
					        get().updateCurrentSession((session) => {
 | 
				
			||||||
          // session.messages.push(userMessage);
 | 
					 | 
				
			||||||
          // session.messages.push(botMessage);
 | 
					 | 
				
			||||||
          session.messages = session.messages.concat([userMessage, botMessage]);
 | 
					          session.messages = session.messages.concat([userMessage, botMessage]);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -289,7 +287,6 @@ export const useChatStore = create<ChatStore>()(
 | 
				
			|||||||
            if (message) {
 | 
					            if (message) {
 | 
				
			||||||
              botMessage.content = message;
 | 
					              botMessage.content = message;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            // set(() => ({}));
 | 
					 | 
				
			||||||
            get().updateCurrentSession((session) => {
 | 
					            get().updateCurrentSession((session) => {
 | 
				
			||||||
              session.messages = session.messages.concat();
 | 
					              session.messages = session.messages.concat();
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
@@ -304,7 +301,6 @@ export const useChatStore = create<ChatStore>()(
 | 
				
			|||||||
              sessionIndex,
 | 
					              sessionIndex,
 | 
				
			||||||
              botMessage.id ?? messageIndex,
 | 
					              botMessage.id ?? messageIndex,
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
            // set(() => ({}));
 | 
					 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          onError(error) {
 | 
					          onError(error) {
 | 
				
			||||||
            const isAborted = error.message.includes("aborted");
 | 
					            const isAborted = error.message.includes("aborted");
 | 
				
			||||||
@@ -320,7 +316,6 @@ export const useChatStore = create<ChatStore>()(
 | 
				
			|||||||
            get().updateCurrentSession((session) => {
 | 
					            get().updateCurrentSession((session) => {
 | 
				
			||||||
              session.messages = session.messages.concat();
 | 
					              session.messages = session.messages.concat();
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            // set(() => ({}));
 | 
					 | 
				
			||||||
            ChatControllerPool.remove(
 | 
					            ChatControllerPool.remove(
 | 
				
			||||||
              sessionIndex,
 | 
					              sessionIndex,
 | 
				
			||||||
              botMessage.id ?? messageIndex,
 | 
					              botMessage.id ?? messageIndex,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user