mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
fix unreachable error branch in fetchConversation causing silent failures
openapi-fetch returns either `{ data }` or `{ error }`, never both. The previous guard checked `!data` first, so HTTP errors always hit that branch and returned early — the `error` toast was unreachable. Failed conversation loads now surface to the user instead of failing silently.
Co-Authored-By: John Chilton <jmchilton@gmail.com>
This commit is contained in:
committed by
Ahmed Awan
co-authored by
John Chilton
parent
c308befda3
commit
4af780eb42
@@ -281,12 +281,13 @@ async function fetchConversation(exchangeId: string) {
|
||||
},
|
||||
});
|
||||
|
||||
if (!fullConversation || fullConversation.length === 0) {
|
||||
return;
|
||||
} else if (error) {
|
||||
if (error) {
|
||||
Toast.error(errorMessageAsString(error, "Failed to load conversation."), "Error loading conversation");
|
||||
return;
|
||||
}
|
||||
if (!fullConversation || fullConversation.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
messages.value = fullConversation.map((msg: any, index: number) => {
|
||||
const message: ChatMessage = {
|
||||
|
||||
Reference in New Issue
Block a user