mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Obs AI Assistant] Avoid showing error toast when action is aborted b… (#195331)
Closes https://github.com/elastic/kibana/issues/186794 ## Summary ### Problem When the user clicks on "Stop generating" while the AI Assistant is generating an answer, an error toast is shown with the error message "Aborted". This is unnecessary as the user knows they aborted their action. ### Solution Do not show an error toast if the action is aborted by the user.
This commit is contained in:
parent
336f824122
commit
43a3d4a68a
1 changed files with 3 additions and 2 deletions
|
@ -104,10 +104,11 @@ function useChatWithoutContext({
|
|||
(error: Error) => {
|
||||
if (error instanceof AbortError) {
|
||||
setChatState(ChatState.Aborted);
|
||||
} else {
|
||||
setChatState(ChatState.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
setChatState(ChatState.Error);
|
||||
|
||||
if (isTokenLimitReachedError(error)) {
|
||||
setMessages((msgs) => [
|
||||
...msgs,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue