mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-24 00:26:39 +08:00
chore: add show api error msg
This commit is contained in:
@ -223,7 +223,12 @@ const Main: FC = () => {
|
||||
const [conversationData, appParams] = await Promise.all([fetchConversations(), fetchAppParams()])
|
||||
|
||||
// handle current conversation id
|
||||
const { data: conversations } = conversationData as { data: ConversationItem[] }
|
||||
const { data: conversations, error } = conversationData as { data: ConversationItem[]; error: string }
|
||||
if (error) {
|
||||
Toast.notify({ type: 'error', message: error })
|
||||
throw new Error(error)
|
||||
return
|
||||
}
|
||||
const _conversationId = getConversationIdFromStorage(APP_ID)
|
||||
const isNotNewConversation = conversations.some(item => item.id === _conversationId)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user