Page MenuHomePhabricator

D8026.diff
No OneTemporary

D8026.diff

diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js
--- a/lib/reducers/message-reducer.js
+++ b/lib/reducers/message-reducer.js
@@ -1496,6 +1496,19 @@
thumbnailEncryptionKey,
});
replaced = true;
+ } else if (mediaUpdate.id) {
+ const { id: newID } = mediaUpdate;
+ // branching for Flow
+ if (singleMedia.type === 'photo') {
+ media.push({ ...singleMedia, id: newID });
+ } else if (singleMedia.type === 'video') {
+ media.push({ ...singleMedia, id: newID });
+ } else if (singleMedia.type === 'encrypted_photo') {
+ media.push({ ...singleMedia, id: newID });
+ } else if (singleMedia.type === 'encrypted_video') {
+ media.push({ ...singleMedia, id: newID });
+ }
+ replaced = true;
}
}
updatedMessage = { ...message, media };
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
@@ -1017,9 +1017,7 @@
type: updateMultimediaMessageMediaActionType,
payload: {
messageID: uploadAfterPreload.messageID,
- currentMediaID: uploadAfterPreload.serverID
- ? uploadAfterPreload.serverID
- : uploadAfterPreload.localID,
+ currentMediaID: result.id ?? uploadAfterPreload.localID,
mediaUpdate,
},
});

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 1:52 PM (1 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611900
Default Alt Text
D8026.diff (1 KB)

Event Timeline