mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-16 21:05:20 +02:00
Defer clearing pending chat screenshots until send commits
This commit is contained in:
parent
ba25c68c0d
commit
18108267d1
1 changed files with 4 additions and 1 deletions
|
|
@ -499,7 +499,6 @@ export default function NewChatPage() {
|
|||
}
|
||||
|
||||
const urlsSnapshot = [...pendingUserImageUrls];
|
||||
setPendingUserImageUrls([]);
|
||||
const { userQuery, userImages } = extractUserTurnForNewChatApi(message, urlsSnapshot);
|
||||
|
||||
if (!userQuery.trim() && userImages.length === 0) return;
|
||||
|
|
@ -544,6 +543,10 @@ export default function NewChatPage() {
|
|||
}
|
||||
}
|
||||
|
||||
if (urlsSnapshot.length > 0) {
|
||||
setPendingUserImageUrls((prev) => prev.filter((u) => !urlsSnapshot.includes(u)));
|
||||
}
|
||||
|
||||
// Add user message to state
|
||||
const userMsgId = `msg-user-${Date.now()}`;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue