Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33309083
D7416.1768803728.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7416.1768803728.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D7416: [web] Fix bug where image appears broken when creating thread with media message
Attached
Detach File
Event Timeline
Log In to Comment