Page MenuHomePhabricator

D11754.diff
No OneTemporary

D11754.diff

diff --git a/native/chat/settings/thread-settings-description.react.js b/native/chat/settings/thread-settings-description.react.js
--- a/native/chat/settings/thread-settings-description.react.js
+++ b/native/chat/settings/thread-settings-description.react.js
@@ -14,7 +14,7 @@
useChangeThreadSettings,
} from 'lib/actions/thread-actions.js';
import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js';
-import { threadHasPermission } from 'lib/shared/thread-utils.js';
+import { useThreadHasPermission } from 'lib/shared/thread-utils.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
@@ -107,6 +107,7 @@
+changeThreadSettings: (
update: UpdateThreadRequest,
) => Promise<ChangeThreadSettingsPayload>,
+ +canEditThreadDescription: boolean,
};
class ThreadSettingsDescription extends React.PureComponent<Props> {
textInput: ?React.ElementRef<typeof BaseTextInput>;
@@ -162,12 +163,8 @@
);
}
- const canEditThreadDescription = threadHasPermission(
- this.props.threadInfo,
- threadPermissions.EDIT_THREAD_DESCRIPTION,
- );
const { panelIosHighlightUnderlay } = this.props.colors;
- if (canEditThreadDescription) {
+ if (this.props.canEditThreadDescription) {
return (
<View>
<ThreadSettingsCategoryHeader type="outline" title="Description" />
@@ -310,6 +307,12 @@
const dispatchActionPromise = useDispatchActionPromise();
const callChangeThreadSettings = useChangeThreadSettings();
+
+ const canEditThreadDescription = useThreadHasPermission(
+ props.threadInfo,
+ threadPermissions.EDIT_THREAD_DESCRIPTION,
+ );
+
return (
<ThreadSettingsDescription
{...props}
@@ -318,6 +321,7 @@
styles={styles}
dispatchActionPromise={dispatchActionPromise}
changeThreadSettings={callChangeThreadSettings}
+ canEditThreadDescription={canEditThreadDescription}
/>
);
});

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 5:57 PM (19 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2591258
Default Alt Text
D11754.diff (2 KB)

Event Timeline