Skip to content

Commit 2cc543d

Browse files
committed
Disable app create unless prompt is given
1 parent cf7b413 commit 2cc543d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/web/src/components/apps/create-modal.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ export default function CreateAppModal({ onClose, onCreate }: PropsType) {
3636

3737
const [submitting, setSubmitting] = useState(false);
3838

39+
const validPrompt = prompt.trim() !== '';
40+
3941
async function onSubmit(e: React.FormEvent) {
4042
e.preventDefault();
4143
e.stopPropagation();
4244

43-
if (submitting) {
45+
if (submitting || !validPrompt) {
4446
return;
4547
}
4648

@@ -130,7 +132,7 @@ export default function CreateAppModal({ onClose, onCreate }: PropsType) {
130132
Cancel
131133
</Button>
132134

133-
<Button disabled={!aiEnabled || submitting} type="submit">
135+
<Button disabled={!aiEnabled || submitting || !validPrompt} type="submit">
134136
{submitting ? (
135137
<div className="flex items-center gap-2">
136138
<Loader2 className="h-4 w-4 animate-spin" /> Generating...

0 commit comments

Comments
 (0)