From be27894f954120cdf6b9c959b62f9258d53f5b76 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Fri, 14 Nov 2025 23:59:55 +0800 Subject: [PATCH] todo: sendingFileSnackbar died --- client/ui/chat/ChatFragment.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/ui/chat/ChatFragment.tsx b/client/ui/chat/ChatFragment.tsx index 631a9fd..36a4b57 100644 --- a/client/ui/chat/ChatFragment.tsx +++ b/client/ui/chat/ChatFragment.tsx @@ -183,6 +183,17 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC const cachedFiles = React.useRef({} as { [fileName: string]: ArrayBuffer }) const cachedFileNamesCount = React.useRef({} as { [fileName: string]: number }) async function sendMessage() { + const sendingFilesSnackbar = snackbar({ + message: `上传文件到 [${chatInfo.title}]...`, + placement: 'top', + autoCloseDelay: 0, + }) + let i = 1 + let i2 = 0 + const sendingFilesSnackbarId = setInterval(() => { + sendingFilesSnackbar.textContent = `上传第 ${i2}/${Object.keys(cachedFiles.current).length} 文件到 [${chatInfo.title}]... ()` + i++ + }, 1000) try { let text = inputRef.current!.value if (text.trim() == '') return