Skip to content

Commit

Permalink
Merge pull request #465 from adarsh-jha-dev/patch-1
Browse files Browse the repository at this point in the history
Add Feedback Feature to Conversation Module (Update conversationSlice.ts)
  • Loading branch information
dartpain authored Oct 7, 2023
2 parents 75100cd + 86c2f07 commit 25ec8fb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions frontend/src/conversation/conversationSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ export const conversationSlice = createSlice({
state,
action: PayloadAction<{ index: number; query: Partial<Query> }>,
) {
const index = action.payload.index;
if (action.payload.query.response) {
const { index, query } = action.payload;
if (query.response) {
state.queries[index].response =
(state.queries[index].response || '') + action.payload.query.response;
(state.queries[index].response || '') + query.response;
} else {
state.queries[index] = {
...state.queries[index],
...action.payload.query,
...query,
};
}
},
Expand All @@ -163,21 +163,21 @@ export const conversationSlice = createSlice({
state,
action: PayloadAction<{ index: number; query: Partial<Query> }>,
) {
const index = action.payload.index;
const { index, query } = action.payload;
if (!state.queries[index].sources) {
state.queries[index].sources = [action.payload.query.sources![0]];
state.queries[index].sources = [query.sources![0]];
} else {
state.queries[index].sources!.push(action.payload.query.sources![0]);
state.queries[index].sources!.push(query.sources![0]);
}
},
updateQuery(
state,
action: PayloadAction<{ index: number; query: Partial<Query> }>,
) {
const index = action.payload.index;
const { index, query } = action.payload;
state.queries[index] = {
...state.queries[index],
...action.payload.query,
...query,
};
},
setStatus(state, action: PayloadAction<Status>) {
Expand Down

2 comments on commit 25ec8fb

@vercel
Copy link

@vercel vercel bot commented on 25ec8fb Oct 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs-gpt – ./frontend

docs-gpt-brown.vercel.app
docs-gpt-arc53.vercel.app
docs-gpt-git-main-arc53.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 25ec8fb Oct 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextra-docsgpt – ./docs

nextra-docsgpt-git-main-arc53.vercel.app
nextra-docsgpt.vercel.app
nextra-docsgpt-arc53.vercel.app
docs.docsgpt.co.uk

Please sign in to comment.