diff --git a/web/input/input-state-container.react.js b/web/input/input-state-container.react.js --- a/web/input/input-state-container.react.js +++ b/web/input/input-state-container.react.js @@ -616,7 +616,7 @@ localID: getNextLocalUploadID(), serverID: null, messageID: null, - failed: null, + failed: false, file: fixedFile, mediaType, dimensions, @@ -682,7 +682,7 @@ ); } catch (e) { uploadExceptionMessage = getMessageForException(e); - this.handleUploadFailure(threadID, localID, e); + this.handleUploadFailure(threadID, localID); } userTime = Date.now() - selectTime; steps.push({ @@ -846,7 +846,7 @@ }); } - handleUploadFailure(threadID: string, localUploadID: string, e: any) { + handleUploadFailure(threadID: string, localUploadID: string) { this.setState(prevState => { const newThreadID = this.getRealizedOrPendingThreadID(threadID); const uploads = prevState.pendingUploads[newThreadID]; @@ -855,7 +855,6 @@ // The upload has been cancelled or completed before it failed return {}; } - const failed = e instanceof Error && e.message ? e.message : 'failed'; return { pendingUploads: { ...prevState.pendingUploads, @@ -863,7 +862,7 @@ ...uploads, [localUploadID]: { ...upload, - failed, + failed: true, progressPercent: 0, abort: null, }, @@ -1173,7 +1172,7 @@ if (uploadIDsToRetry.has(localID) && !pendingUpload.serverID) { newPendingUploads[localID] = { ...pendingUpload, - failed: null, + failed: false, progressPercent: 0, abort: null, }; diff --git a/web/input/input-state.js b/web/input/input-state.js --- a/web/input/input-state.js +++ b/web/input/input-state.js @@ -16,8 +16,8 @@ serverID: ?string, // Pending uploads are assigned a messageID once they are sent messageID: ?string, - // This is set to truthy if the upload fails for whatever reason - failed: ?string, + // This is set to true if the upload fails for whatever reason + failed: boolean, file: File, mediaType: MediaType, dimensions: ?Dimensions,