mirror of
https://github.com/moghtech/komodo.git
synced 2026-03-09 07:13:36 -05:00
[PR #800] [MERGED] Fix: Submit button remains disabled after failed API calls #790
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/moghtech/komodo/pull/800
Author: @antoniosarro
Created: 9/2/2025
Status: ✅ Merged
Merged: 9/2/2025
Merged by: @mbecker20
Base:
1.19.3← Head:fix/new-stack-create📝 Commits (1)
4bc0449fix: inconsistent behaviour of new resource create button📊 Changes
1 file changed (+9 additions, -3 deletions)
View changed files
📝
frontend/src/components/layouts.tsx(+9 -3)📄 Description
Resolves #771
Problem
When creating a new resource with a duplicate name, the API call fails but the submit button becomes permanently disabled. Even after updating the input field with a valid name, the button stays disabled because the dialog was closing on error, preventing proper state re-evaluation.
Root Cause
The original code called
set(false)andsetLoading(false)regardless of success/failure, causing the component to unmount before theenabled={!!name}prop could be re-evaluated.Solution
Added proper error handling in
NewLayoutcomponent:onConfirm()in try-catch blockfinallyblockImpact
This fix applies to all resource creation flows that use the
NewResourcecomponent, including Deployments, Stacks, Repos and Builds.This ensures the button's enabled state is properly re-evaluated after failed operations across all resource types.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.