forked from XiaoMo/ChatGPT-Next-Web
fix: #1685 clear context index should be recoverable
This commit is contained in:
parent
37da759fd5
commit
57514e91b6
@ -265,7 +265,7 @@ function ClearContextDivider() {
|
|||||||
className={chatStyle["clear-context"]}
|
className={chatStyle["clear-context"]}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
chatStore.updateCurrentSession(
|
chatStore.updateCurrentSession(
|
||||||
(session) => (session.clearContextIndex = -1),
|
(session) => (session.clearContextIndex = undefined),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@ -388,7 +388,7 @@ export function ChatActions(props: {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
chatStore.updateCurrentSession((session) => {
|
chatStore.updateCurrentSession((session) => {
|
||||||
if (session.clearContextIndex === session.messages.length) {
|
if (session.clearContextIndex === session.messages.length) {
|
||||||
session.clearContextIndex = -1;
|
session.clearContextIndex = undefined;
|
||||||
} else {
|
} else {
|
||||||
session.clearContextIndex = session.messages.length;
|
session.clearContextIndex = session.messages.length;
|
||||||
session.memoryPrompt = ""; // will clear memory
|
session.memoryPrompt = ""; // will clear memory
|
||||||
|
Loading…
Reference in New Issue
Block a user