fix: 消息發送失敗時, 沒有取消 加載狀態

This commit is contained in:
CrescentLeaf
2025-10-02 18:49:19 +08:00
parent e429bbbcdb
commit 15c4bcd48e

View File

@@ -144,7 +144,7 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC
target, target,
data: cachedFiles.current[fileName], data: cachedFiles.current[fileName],
}, 5000) }, 5000)
if (checkApiSuccessOrSncakbar(re, `文件[${fileName}] 上傳失敗`)) return if (checkApiSuccessOrSncakbar(re, `文件[${fileName}] 上傳失敗`)) return setIsMessageSending(false)
text = text.replaceAll('(' + fileName + ')', '(' + re.data!.file_path as string + ')') text = text.replaceAll('(' + fileName + ')', '(' + re.data!.file_path as string + ')')
} }
} }
@@ -154,7 +154,7 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC
target, target,
text, text,
}, 5000) }, 5000)
if (checkApiSuccessOrSncakbar(re, "發送失敗")) return if (checkApiSuccessOrSncakbar(re, "發送失敗")) return setIsMessageSending(false)
inputRef.current!.value = '' inputRef.current!.value = ''
cachedFiles.current = {} cachedFiles.current = {}
} catch (e) { } catch (e) {