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, + +canEditThreadDescription: boolean, }; class ThreadSettingsDescription extends React.PureComponent { textInput: ?React.ElementRef; @@ -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 ( @@ -310,6 +307,12 @@ const dispatchActionPromise = useDispatchActionPromise(); const callChangeThreadSettings = useChangeThreadSettings(); + + const canEditThreadDescription = useThreadHasPermission( + props.threadInfo, + threadPermissions.EDIT_THREAD_DESCRIPTION, + ); + return ( ); });