Page MenuHomePhabricator

D11477.diff
No OneTemporary

D11477.diff

diff --git a/native/input/input-state-container.react.js b/native/input/input-state-container.react.js
--- a/native/input/input-state-container.react.js
+++ b/native/input/input-state-container.react.js
@@ -729,7 +729,7 @@
threadInfo: ThreadInfo,
): Promise<?string> {
const { ids, selection } = uploadFileInput;
- const { localMediaID } = ids;
+ const { localMediaID, localThumbnailID } = ids;
const start = selection.sendTime;
const steps: Array<MediaMissionStep> = [selection];
let encryptionSteps: $ReadOnlyArray<MediaMissionStep> = [];
@@ -758,7 +758,7 @@
};
const onUploadFailed = (message: string) => {
errorMessage = message;
- this.handleUploadFailure(localMessageID, localMediaID);
+ this.handleUploadFailure(localMessageID, localMediaID, localThumbnailID);
userTime = Date.now() - start;
};
@@ -1260,25 +1260,42 @@
}
};
- handleUploadFailure(localMessageID: string, localUploadID: string) {
+ handleUploadFailure(
+ localMessageID: string,
+ localUploadID: string,
+ localThumbnailID: ?string,
+ ) {
this.setState(prevState => {
const uploads = prevState.pendingUploads[localMessageID];
+
const upload = uploads[localUploadID];
- if (!upload) {
+ const thumbnailUpload = localThumbnailID
+ ? uploads[localThumbnailID]
+ : undefined;
+ if (!upload && !thumbnailUpload) {
// The upload has been completed before it failed
return {};
}
+
+ const newUploads = { ...uploads };
+ newUploads[localUploadID] = {
+ ...upload,
+ failed: true,
+ progressPercent: 0,
+ };
+ if (localThumbnailID) {
+ newUploads[localThumbnailID] = {
+ processingStep: null,
+ ...thumbnailUpload,
+ failed: true,
+ progressPercent: 0,
+ };
+ }
+
return {
pendingUploads: {
...prevState.pendingUploads,
- [localMessageID]: {
- ...uploads,
- [localUploadID]: {
- ...upload,
- failed: true,
- progressPercent: 0,
- },
- },
+ [localMessageID]: newUploads,
},
};
});

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 1, 1:13 AM (16 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2603115
Default Alt Text
D11477.diff (2 KB)

Event Timeline