Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3377769
D3768.id11750.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
D3768.id11750.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
@@ -98,6 +98,7 @@
+onChangeName: (event: SyntheticEvent<HTMLInputElement>) => void,
+onChangeDescription: (event: SyntheticEvent<HTMLTextAreaElement>) => void,
+onChangeColor: (color: string) => void,
+ +onChangeThreadType: (event: SyntheticEvent<HTMLInputElement>) => void,
};
class ThreadSettingsModal extends React.PureComponent<Props> {
nameInput: ?HTMLInputElement;
@@ -183,7 +184,7 @@
mainContent = (
<ThreadSettingsPrivacyTab
possiblyChangedThreadType={this.possiblyChangedValue('type')}
- onChangeThreadType={this.onChangeThreadType}
+ onChangeThreadType={this.props.onChangeThreadType}
inputDisabled={inputDisabled}
/>
);
@@ -296,18 +297,6 @@
this.accountPasswordInput = accountPasswordInput;
};
- onChangeThreadType = (event: SyntheticEvent<HTMLInputElement>) => {
- const uiValue = assertThreadType(parseInt(event.currentTarget.value, 10));
- const newValue =
- uiValue !== this.props.threadInfo.type ? uiValue : undefined;
- this.props.setQueuedChanges(
- Object.freeze({
- ...this.props.queuedChanges,
- type: newValue,
- }),
- );
- };
-
onChangeAccountPassword = (event: SyntheticEvent<HTMLInputElement>) => {
const target = event.currentTarget;
this.props.setAccountPassword(target.value);
@@ -458,6 +447,21 @@
[queuedChanges, threadInfo?.color],
);
+ const onChangeThreadType = React.useCallback(
+ (event: SyntheticEvent<HTMLInputElement>) => {
+ const uiValue = assertThreadType(
+ parseInt(event.currentTarget.value, 10),
+ );
+ setQueuedChanges(
+ Object.freeze({
+ ...queuedChanges,
+ type: uiValue !== threadInfo?.type ? uiValue : undefined,
+ }),
+ );
+ },
+ [queuedChanges, threadInfo?.type],
+ );
+
if (!threadInfo) {
return (
<Modal onClose={modalContext.clearModal} name="Invalid thread">
@@ -492,6 +496,7 @@
onChangeName={onChangeName}
onChangeDescription={onChangeDescription}
onChangeColor={onChangeColor}
+ onChangeThreadType={onChangeThreadType}
/>
);
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 7:19 AM (21 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2593226
Default Alt Text
D3768.id11750.diff (2 KB)
Attached To
Mode
D3768: [web] Move `onChangeThreadType` up from `ThreadSettingsModal` to `ConnectedThreadSettingsModal`
Attached
Detach File
Event Timeline
Log In to Comment