Commit 0842045
committed
[Nebula] Remove presence message when adding an error message (#5711)
Fixes: DASH-614
<!-- start pr-codex -->
---
## PR-Codex overview
This PR focuses on improving error handling in the `setMessages` function within the `ChatPageContent` component. It modifies how error messages are added to the message list, ensuring that the previous messages are preserved correctly.
### Detailed summary
- Refactored `setMessages` to create a new array `newMessages` based on previous messages.
- Added a condition to exclude the last message if its type is "presence".
- Pushed a new error message object containing the error details to `newMessages`.
- Returned `newMessages` from `setMessages`.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->1 parent 611ed23 commit 0842045
File tree
1 file changed
+13
-5
lines changed- apps/dashboard/src/app/nebula-app/(app)/components
1 file changed
+13
-5
lines changedLines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
247 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
248 | 254 | | |
249 | 255 | | |
250 | | - | |
251 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
252 | 260 | | |
253 | 261 | | |
254 | 262 | | |
| |||
0 commit comments