mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	Merge pull request #721 from helloworld-xdy/main
fix:修复正常响应结果后额外追加‘出错了,请稍后再试’bug
This commit is contained in:
		@@ -171,10 +171,15 @@ export async function requestChatStream(
 | 
				
			|||||||
        const resTimeoutId = setTimeout(() => finish(), TIME_OUT_MS);
 | 
					        const resTimeoutId = setTimeout(() => finish(), TIME_OUT_MS);
 | 
				
			||||||
        const content = await reader?.read();
 | 
					        const content = await reader?.read();
 | 
				
			||||||
        clearTimeout(resTimeoutId);
 | 
					        clearTimeout(resTimeoutId);
 | 
				
			||||||
        const text = decoder.decode(content?.value, { stream: true });
 | 
					      
 | 
				
			||||||
 | 
					        if (!content || !content.value) {
 | 
				
			||||||
 | 
					          break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
 | 
					        const text = decoder.decode(content.value, { stream: true });
 | 
				
			||||||
        responseText += text;
 | 
					        responseText += text;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const done = !content || content.done;
 | 
					        const done = content.done;
 | 
				
			||||||
        options?.onMessage(responseText, false);
 | 
					        options?.onMessage(responseText, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (done) {
 | 
					        if (done) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user