mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-07-12 12:37:32 +00:00
Allow stalled chat uploads to be cancelled
This commit is contained in:
@@ -292,6 +292,9 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer
|
||||
|
||||
// If currently streaming, stop it
|
||||
if (isStreaming) {
|
||||
if (fileHandlerModule.isUploading && fileHandlerModule.isUploading()) {
|
||||
fileHandlerModule.cancelUpload && fileHandlerModule.cancelUpload();
|
||||
}
|
||||
// Cancel server-side research if in progress
|
||||
const _cancelSid = sessionModule.getCurrentSessionId();
|
||||
if (_cancelSid && _researchingStreamIds.has(_cancelSid)) {
|
||||
@@ -687,6 +690,15 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer
|
||||
} catch(e) {
|
||||
console.error('upload failed', e);
|
||||
}
|
||||
if (_pendingAttachInfo && !ids.length && !(_pendingRegenAttachments && _pendingRegenAttachments.length)) {
|
||||
if (_userMsgEl && _userMsgEl.parentNode) _userMsgEl.remove();
|
||||
if (fileHandlerModule.wasLastUploadCancelled && !fileHandlerModule.wasLastUploadCancelled()) {
|
||||
uiModule.showError && uiModule.showError('Upload failed. Attachment kept so you can retry.');
|
||||
}
|
||||
updateSubmitButton('idle', submitBtn);
|
||||
_releaseSendFlag();
|
||||
return;
|
||||
}
|
||||
|
||||
// Carry over the original message's file-ids on a regenerate so the new
|
||||
// send still references the same photos / docs (and picks up the user's
|
||||
|
||||
Reference in New Issue
Block a user