@@ -7,7 +7,6 @@ import { useTranslation } from '@/src/hooks/useTranslation';
77import { topicToOption } from '@/src/utils/app/application' ;
88import { getLastPathSegment } from '@/src/utils/app/common' ;
99import { preventEnterDown } from '@/src/utils/app/forms' ;
10- import { isToolsetSignedIn } from '@/src/utils/app/toolsets' ;
1110
1211import { ScreenState } from '@/src/types/common' ;
1312import { ToolsetModel } from '@/src/types/toolsets' ;
@@ -59,20 +58,12 @@ export const GeneralForm = ({
5958 const screenState = useScreenState ( ) ;
6059 const isMobileView = screenState === ScreenState . SM ;
6160 const isEditing = ! ! toolset ;
62- const isLoggedIn = toolset && isToolsetSignedIn ( toolset ) ;
6361
6462 const { register, control } = useFormContext < ToolsetEditorForm > ( ) ;
6563 const { errors, isValid } = useFormState < ToolsetEditorForm > ( { control } ) ;
6664
6765 const topicOptions = useMemo ( ( ) => topics . map ( topicToOption ) , [ topics ] ) ;
6866
69- const disabledReason = useMemo ( ( ) => {
70- if ( isToolsetPublic ) return PUBLIC_TOOLSET_TOOLTIP ;
71- if ( isLoggedIn ) return t ( CommonI18nKeys . LogOutBeforeEditingToolset ) ;
72-
73- return undefined ;
74- } , [ isLoggedIn , isToolsetPublic , t ] ) ;
75-
7667 const getLogoId = useCallback (
7768 ( filesIds : string [ ] ) => files . find ( ( f ) => f . id === filesIds [ 0 ] ) ?. id ,
7869 [ files ] ,
@@ -97,9 +88,9 @@ export const GeneralForm = ({
9788 mandatory
9889 placeholder = { t ( CommonI18nKeys . TypeName ) }
9990 id = "name"
100- disabled = { ! ! disabledReason }
91+ disabled = { isToolsetPublic }
10192 error = { errors . name ?. message }
102- tooltip = { disabledReason }
93+ tooltip = { isToolsetPublic ? PUBLIC_TOOLSET_TOOLTIP : undefined }
10394 />
10495 < Field
10596 { ...register ( 'version' ) }
@@ -108,8 +99,8 @@ export const GeneralForm = ({
10899 mandatory
109100 placeholder = { DEFAULT_VERSION }
110101 id = "version"
111- disabled = { ! ! disabledReason }
112- tooltip = { disabledReason }
102+ disabled = { isToolsetPublic }
103+ tooltip = { isToolsetPublic ? PUBLIC_TOOLSET_TOOLTIP : undefined }
113104 error = { errors . version ?. message }
114105 name = "version"
115106 />
0 commit comments