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, @@ -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,9 @@ ...uploads, [localUploadID]: { ...upload, - failed, + failed: true, + failureMessage: + e instanceof Error && e.message ? e.message : 'failed', progressPercent: 0, abort: null, }, @@ -1173,7 +1174,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,9 @@ 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, + failureMessage?: string, file: File, mediaType: MediaType, dimensions: ?Dimensions,