update state management

This commit is contained in:
Nate 2024-11-21 08:38:31 -08:00
parent e93ae59482
commit b8992b3560
2 changed files with 12 additions and 1 deletions

View file

@ -180,7 +180,7 @@ export function Chat() {
isMetaEquivalentKeyPressed(e) &&
!e.shiftKey
) {
dispatch(setInactive());
dispatch(cancelGeneration());
}
};
window.addEventListener("keydown", listener);
@ -502,3 +502,6 @@ export function Chat() {
</>
);
}
function cancelGeneration(): any {
throw new Error("Function not implemented.");
}

View file

@ -178,6 +178,8 @@ export const stateSlice = createSlice({
contextItems: [],
});
state.currentToolCallState = {};
// https://github.com/continuedev/continue/pull/1021
state.active = true;
},
@ -261,6 +263,11 @@ export const stateSlice = createSlice({
state.isGatheringContext = false;
state.active = false;
},
cancelGeneration: (state) => {
state.isGatheringContext = false;
state.active = false;
state.currentToolCallState = {};
},
abortStream: (state) => {
state.streamAborter.abort();
state.streamAborter = new AbortController();
@ -312,6 +319,7 @@ export const stateSlice = createSlice({
state.active = false;
state.isGatheringContext = false;
state.isMultifileEdit = false;
state.currentToolCallState = {};
if (payload) {
state.history = payload.history as any;
state.title = payload.title;