Skip to content

Commit 1e3507e

Browse files
committed
fixing validation logic
1 parent fca9c48 commit 1e3507e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

components/dashboard/src/repositories/detail/RepositoryName.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const RepositoryNameForm: FC<Props> = ({ project }) => {
2222
const updateProject = useUpdateProject();
2323
const [projectName, setProjectName] = useState(project.name);
2424

25-
const nameError = useOnBlurError("Sorry, this name is too long.", projectName.length > 32);
25+
const nameError = useOnBlurError("Sorry, this name is too long.", projectName.length <= 32);
2626

2727
const updateName = useCallback(
2828
async (e: React.FormEvent) => {
@@ -54,7 +54,12 @@ export const RepositoryNameForm: FC<Props> = ({ project }) => {
5454
/>
5555

5656
{/* Don't disable button, just handle error and message */}
57-
<Button className="mt-4" htmlType="submit" disabled={project.name === projectName || !nameError.isValid}>
57+
<Button
58+
className="mt-4"
59+
htmlType="submit"
60+
disabled={project.name === projectName || !nameError.isValid}
61+
loading={updateProject.isLoading}
62+
>
5863
Update Name
5964
</Button>
6065
</form>

0 commit comments

Comments
 (0)