Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3390849
D11477.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11477.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11477: [native] Make thumbnail failed when main upload fails
Attached
Detach File
Event Timeline
Log In to Comment