mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	Merge pull request #1843 from Yidadaa/bugfix-0607
fix: #1685 clear context index should be recoverable
This commit is contained in:
		@@ -265,7 +265,7 @@ function ClearContextDivider() {
 | 
			
		||||
      className={chatStyle["clear-context"]}
 | 
			
		||||
      onClick={() =>
 | 
			
		||||
        chatStore.updateCurrentSession(
 | 
			
		||||
          (session) => (session.clearContextIndex = -1),
 | 
			
		||||
          (session) => (session.clearContextIndex = undefined),
 | 
			
		||||
        )
 | 
			
		||||
      }
 | 
			
		||||
    >
 | 
			
		||||
@@ -388,7 +388,7 @@ export function ChatActions(props: {
 | 
			
		||||
        onClick={() => {
 | 
			
		||||
          chatStore.updateCurrentSession((session) => {
 | 
			
		||||
            if (session.clearContextIndex === session.messages.length) {
 | 
			
		||||
              session.clearContextIndex = -1;
 | 
			
		||||
              session.clearContextIndex = undefined;
 | 
			
		||||
            } else {
 | 
			
		||||
              session.clearContextIndex = session.messages.length;
 | 
			
		||||
              session.memoryPrompt = ""; // will clear memory
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user