MCPcopy Create free account
hub / github.com/RioArisk/claudecode_api_RemoteControl / clearPendingImage

Function clearPendingImage

app/src/modules/image-upload.js:103–115  ·  view source on GitHub ↗
({ abortUpload = true } = {})

Source from the content-addressed store, hash-verified

101}
102
103export function clearPendingImage({ abortUpload = true } = {}) {
104 const currentImage = pendingImage;
105 if (currentImage && abortUpload && currentImage.uploadId && S.ws && S.ws.readyState === WebSocket.OPEN &&
106 currentImage.status !== 'submitted') {
107 S.ws.send(JSON.stringify({ type: 'image_upload_abort', uploadId: currentImage.uploadId }));
108 }
109 if (currentImage?.previewUrl) {
110 try { URL.revokeObjectURL(currentImage.previewUrl); } catch {}
111 }
112 setPendingImage(null);
113 updateImagePreviewUi();
114 updateSendBtn();
115}
116
117function fileChunkToBase64(blob) {
118 return new Promise((resolve, reject) => {

Callers 3

clearConversationUiFunction · 0.90
submitPendingImageUploadFunction · 0.70
initImageUploadFunction · 0.70

Calls 3

setPendingImageFunction · 0.90
updateSendBtnFunction · 0.90
updateImagePreviewUiFunction · 0.70

Tested by

no test coverage detected