fix(projects): disable create while the team selection is invalid

The inline at-least-one-team hint showed red while the Create button
stayed clickable (toast on click). Invalid state now disables the button,
matching the empty-title condition; the submit-time toast stays as the
server-rule backstop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Naiyuan Qing
2026-07-06 18:43:27 +08:00
committed by Jiayuan Zhang
parent b8f393cce7
commit cccb146a98

View File

@@ -881,7 +881,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
<Button
size="sm"
onClick={handleSubmit}
disabled={!title.trim() || submitting}
disabled={!title.trim() || submitting || (teams.length > 0 && teamIds.length === 0)}
className="shrink-0"
>
{submitting ? t(($) => $.create_project.submitting) : t(($) => $.create_project.submit)}