diff --git a/web/modals/threads/settings/thread-settings-general-tab.react.js b/web/modals/threads/settings/thread-settings-general-tab.react.js --- a/web/modals/threads/settings/thread-settings-general-tab.react.js +++ b/web/modals/threads/settings/thread-settings-general-tab.react.js @@ -6,8 +6,13 @@ changeThreadSettingsActionTypes, changeThreadSettings, } from 'lib/actions/thread-actions'; +import { threadHasPermission } from 'lib/shared/thread-utils'; import { type SetState } from 'lib/types/hook-types'; -import { type ThreadInfo, type ThreadChanges } from 'lib/types/thread-types'; +import { + type ThreadInfo, + type ThreadChanges, + threadPermissions, +} from 'lib/types/thread-types'; import { useDispatchActionPromise, useServerCall, @@ -128,6 +133,11 @@ [changeThreadSettingsAction, dispatchActionPromise], ); + const threadNameInputDisabled = React.useMemo( + () => !threadHasPermission(threadInfo, threadPermissions.EDIT_THREAD_NAME), + [threadInfo], + ); + return (
@@ -138,7 +148,7 @@ value={firstLine(queuedChanges.name ?? threadInfo.name)} placeholder={threadNamePlaceholder} onChange={onChangeName} - disabled={inputDisabled} + disabled={inputDisabled || threadNameInputDisabled} ref={nameInputRef} />
diff --git a/web/modals/threads/settings/thread-settings-modal.react.js b/web/modals/threads/settings/thread-settings-modal.react.js --- a/web/modals/threads/settings/thread-settings-modal.react.js +++ b/web/modals/threads/settings/thread-settings-modal.react.js @@ -69,9 +69,13 @@ const hasPermissionForTab = React.useCallback( (thread: ThreadInfo, tab: TabType) => { if (tab === 'general') { - return threadHasPermission( - thread, - threadPermissions.EDIT_THREAD_NAME, + return ( + threadHasPermission(thread, threadPermissions.EDIT_THREAD_NAME) || + threadHasPermission(thread, threadPermissions.EDIT_THREAD_COLOR) || + threadHasPermission( + thread, + threadPermissions.EDIT_THREAD_DESCRIPTION, + ) ); } else if (tab === 'privacy') { return threadHasPermission(