Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32593596
D3890.1767420267.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D3890.1767420267.diff
View Options
diff --git a/web/modals/threads/thread-settings-general-tab.react.js b/web/modals/threads/thread-settings-general-tab.react.js
--- a/web/modals/threads/thread-settings-general-tab.react.js
+++ b/web/modals/threads/thread-settings-general-tab.react.js
@@ -58,42 +58,42 @@
const onChangeName = React.useCallback(
(event: SyntheticEvent<HTMLInputElement>) => {
const target = event.currentTarget;
- setQueuedChanges(
+ setQueuedChanges(prevQueuedChanges =>
Object.freeze({
- ...queuedChanges,
+ ...prevQueuedChanges,
name: firstLine(
target.value !== threadInfo.name ? target.value : undefined,
),
}),
);
},
- [queuedChanges, setQueuedChanges, threadInfo.name],
+ [setQueuedChanges, threadInfo.name],
);
const onChangeDescription = React.useCallback(
(event: SyntheticEvent<HTMLTextAreaElement>) => {
const target = event.currentTarget;
- setQueuedChanges(
+ setQueuedChanges(prevQueuedChanges =>
Object.freeze({
- ...queuedChanges,
+ ...prevQueuedChanges,
description:
target.value !== threadInfo.description ? target.value : undefined,
}),
);
},
- [queuedChanges, setQueuedChanges, threadInfo.description],
+ [setQueuedChanges, threadInfo.description],
);
const onChangeColor = React.useCallback(
(color: string) => {
- setQueuedChanges(
+ setQueuedChanges(prevQueuedChanges =>
Object.freeze({
- ...queuedChanges,
+ ...prevQueuedChanges,
color: color !== threadInfo.color ? color : undefined,
}),
);
},
- [queuedChanges, setQueuedChanges, threadInfo.color],
+ [setQueuedChanges, threadInfo.color],
);
const changeThreadSettingsAction = React.useCallback(async () => {
diff --git a/web/modals/threads/thread-settings-privacy-tab.react.js b/web/modals/threads/thread-settings-privacy-tab.react.js
--- a/web/modals/threads/thread-settings-privacy-tab.react.js
+++ b/web/modals/threads/thread-settings-privacy-tab.react.js
@@ -55,14 +55,14 @@
const onChangeThreadType = React.useCallback(
(event: SyntheticEvent<HTMLInputElement>) => {
const uiValue = assertThreadType(parseInt(event.currentTarget.value, 10));
- setQueuedChanges(
+ setQueuedChanges(prevQueuedChanges =>
Object.freeze({
- ...queuedChanges,
+ ...prevQueuedChanges,
type: uiValue !== threadInfo.type ? uiValue : undefined,
}),
);
},
- [queuedChanges, setQueuedChanges, threadInfo.type],
+ [setQueuedChanges, threadInfo.type],
);
const changeThreadSettingsAction = React.useCallback(async () => {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 3, 6:04 AM (5 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5886338
Default Alt Text
D3890.1767420267.diff (2 KB)
Attached To
Mode
D3890: [web] Use callback version of set state for `setQueuedChanges`
Attached
Detach File
Event Timeline
Log In to Comment