Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Amelio] AAU, chat input is emptied as soon as i submit the question #1753

Closed
mamadoudicko opened this issue Nov 29, 2023 · 1 comment
Closed
Assignees
Labels
area: frontend Related to frontend functionality or under the /frontend directory

Comments

@mamadoudicko
Copy link
Contributor

mamadoudicko commented Nov 29, 2023

Demo:

Screen.Recording.2023-11-29.at.16.50.59.mp4
Copy link

dosubot bot commented Nov 29, 2023

🤖

Hi @mamadoudicko! It's good to see you again. I hope you're doing well.

Based on the information provided, it seems like the chat input is designed to be emptied as soon as you submit a question. This behavior is defined in the submitQuestion function from the useChatInput hook. Here is the relevant part of the code:

const submitQuestion = () => {
  if (!generatingAnswer) {
    void addQuestion(message, () => setMessage(""));
  }
};

The addQuestion function is called with the current message and a callback function. The callback function () => setMessage("") is executed after the question is successfully added, which clears the chat input by setting the message state to an empty string. This is done to ensure that the input field is ready for the next user input.

As for the generatingAnswer variable, it is used as a condition to check if the system is currently generating an answer. If the system is not generating an answer (generatingAnswer is false), then the function addQuestion is called. This prevents the user from submitting a new question while the system is still processing the previous one.

You can find more details in the source code here:

I also found a similar issue that was resolved in the past:

I hope this helps! If you have any other questions or need further clarification, feel free to ask.

Best,
Dosu

Sources

@dosubot dosubot bot added the area: frontend Related to frontend functionality or under the /frontend directory label Nov 29, 2023
@mamadoudicko mamadoudicko self-assigned this Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: frontend Related to frontend functionality or under the /frontend directory
Projects
None yet
Development

No branches or pull requests

1 participant