Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3529931
D7342.id24781.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
D7342.id24781.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
@@ -92,6 +92,7 @@
import { useIsReportEnabled } from 'lib/utils/report-utils.js';
import {
+ type EditState,
InputStateContext,
type PendingMultimediaUploads,
type MultimediaProcessingStep,
@@ -150,10 +151,14 @@
};
type State = {
+pendingUploads: PendingMultimediaUploads,
+ +editState: EditState,
};
class InputStateContainer extends React.PureComponent<Props, State> {
state: State = {
pendingUploads: {},
+ editState: {
+ editedMessageID: null,
+ },
};
sendCallbacks: Array<() => void> = [];
activeURIs = new Map();
@@ -380,7 +385,8 @@
inputStateSelector = createSelector(
(state: State) => state.pendingUploads,
- (pendingUploads: PendingMultimediaUploads) => ({
+ (state: State) => state.editState,
+ (pendingUploads: PendingMultimediaUploads, editState: EditState) => ({
pendingUploads,
sendTextMessage: this.sendTextMessage,
sendMultimediaMessage: this.sendMultimediaMessage,
@@ -394,6 +400,8 @@
uploadInProgress: this.uploadInProgress,
reportURIDisplayed: this.reportURIDisplayed,
setPendingThreadUpdateHandler: this.setPendingThreadUpdateHandler,
+ editState,
+ setEditedMessageID: this.setEditedMessageID,
}),
);
@@ -1195,6 +1203,12 @@
this.replyCallbacks.push(callbackReply);
};
+ setEditedMessageID = (messageID: ?string) => {
+ this.setState({
+ editState: { editedMessageID: messageID },
+ });
+ };
+
removeReplyListener = (callbackReply: (message: string) => void) => {
this.replyCallbacks = this.replyCallbacks.filter(
candidate => candidate !== callbackReply,
diff --git a/native/input/input-state.js b/native/input/input-state.js
--- a/native/input/input-state.js
+++ b/native/input/input-state.js
@@ -22,6 +22,10 @@
[localMessageID: string]: MessagePendingUploads,
};
+export type EditState = {
+ +editedMessageID: ?string,
+};
+
export type InputState = {
+pendingUploads: PendingMultimediaUploads,
+sendTextMessage: (
@@ -50,6 +54,8 @@
threadID: string,
pendingThreadUpdateHandler: ?(ThreadInfo) => mixed,
) => void,
+ +editState: EditState,
+ +setEditedMessageID: (editedMessageID: ?string) => void,
};
const InputStateContext: React.Context<?InputState> =
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 10:14 PM (12 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2703301
Default Alt Text
D7342.id24781.diff (2 KB)
Attached To
Mode
D7342: [native] Add EditState to the InputState
Attached
Detach File
Event Timeline
Log In to Comment