Page MenuHomePhorge

D7416.1768803728.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D7416.1768803728.diff

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
@@ -422,11 +422,31 @@
this.pendingThreadCreations.delete(messageInfo.threadID);
}
- const newMessageInfo = {
- ...messageInfo,
- threadID: newThreadID,
- time: Date.now(),
- };
+ // While the thread was being created, the image preload may have completed,
+ // and we might have a finalized URI now. So we fetch from Redux again
+ const { localID } = messageInfo;
+ invariant(
+ localID !== null && localID !== undefined,
+ 'localID should exist for locally-created RawMessageInfo',
+ );
+ const latestMessageInfo = this.getRawMultimediaMessageInfo(localID);
+
+ // Conditional is necessary for Flow
+ let newMessageInfo;
+ if (latestMessageInfo.type === messageTypes.MULTIMEDIA) {
+ newMessageInfo = {
+ ...latestMessageInfo,
+ threadID: newThreadID,
+ time: Date.now(),
+ };
+ } else {
+ newMessageInfo = {
+ ...latestMessageInfo,
+ threadID: newThreadID,
+ time: Date.now(),
+ };
+ }
+
this.props.dispatchActionPromise(
sendMultimediaMessageActionTypes,
this.sendMultimediaMessageAction(newMessageInfo),

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 19, 6:22 AM (16 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5954817
Default Alt Text
D7416.1768803728.diff (1 KB)

Event Timeline