Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#1843 from Yidadaa/bugfix-0607
Browse files Browse the repository at this point in the history
fix: ChatGPTNextWeb#1685 clear context index should be recoverable
  • Loading branch information
Yidadaa authored Jun 6, 2023
2 parents a9d336b + 57514e9 commit 773641a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ function ClearContextDivider() {
className={chatStyle["clear-context"]}
onClick={() =>
chatStore.updateCurrentSession(
(session) => (session.clearContextIndex = -1),
(session) => (session.clearContextIndex = undefined),
)
}
>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 773641a

Please sign in to comment.