Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3174905
D3766.id11744.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
D3766.id11744.diff
View Options
diff --git a/web/modals/threads/thread-settings-modal.react.js b/web/modals/threads/thread-settings-modal.react.js
--- a/web/modals/threads/thread-settings-modal.react.js
+++ b/web/modals/threads/thread-settings-modal.react.js
@@ -96,6 +96,7 @@
+namePlaceholder: string,
+changeQueued: boolean,
+onChangeName: (event: SyntheticEvent<HTMLInputElement>) => void,
+ +onChangeDescription: (event: SyntheticEvent<HTMLTextAreaElement>) => void,
};
class ThreadSettingsModal extends React.PureComponent<Props> {
nameInput: ?HTMLInputElement;
@@ -171,7 +172,7 @@
threadNameDisabled={inputDisabled}
threadNameInputRef={this.nameInputRef}
threadDescriptionValue={this.possiblyChangedValue('description')}
- threadDescriptionOnChange={this.onChangeDescription}
+ threadDescriptionOnChange={this.props.onChangeDescription}
threadDescriptionDisabled={inputDisabled}
threadColorCurrentColor={this.possiblyChangedValue('color')}
threadColorOnColorSelection={this.onChangeColor}
@@ -294,20 +295,6 @@
this.accountPasswordInput = accountPasswordInput;
};
- onChangeDescription = (event: SyntheticEvent<HTMLTextAreaElement>) => {
- const target = event.currentTarget;
- const newValue =
- target.value !== this.props.threadInfo.description
- ? target.value
- : undefined;
- this.props.setQueuedChanges(
- Object.freeze({
- ...this.props.queuedChanges,
- description: newValue,
- }),
- );
- };
-
onChangeColor = (color: string) => {
const newValue = color !== this.props.threadInfo.color ? color : undefined;
this.props.setQueuedChanges(
@@ -452,6 +439,18 @@
[queuedChanges, threadInfo?.name],
);
+ const onChangeDescription = React.useCallback(
+ (event: SyntheticEvent<HTMLTextAreaElement>) => {
+ const target = event.currentTarget;
+ setQueuedChanges({
+ ...queuedChanges,
+ description:
+ target.value !== threadInfo?.description ? target.value : undefined,
+ });
+ },
+ [queuedChanges, threadInfo?.description],
+ );
+
if (!threadInfo) {
return (
<Modal onClose={modalContext.clearModal} name="Invalid thread">
@@ -484,6 +483,7 @@
namePlaceholder={namePlaceholder}
changeQueued={changeQueued}
onChangeName={onChangeName}
+ onChangeDescription={onChangeDescription}
/>
);
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 8, 7:05 PM (18 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2444556
Default Alt Text
D3766.id11744.diff (2 KB)
Attached To
Mode
D3766: [web] Move `onChangeDescription` up from `ThreadSettingsModal` to `ConnectedThreadSettingsModal`
Attached
Detach File
Event Timeline
Log In to Comment