Fix AI chat: disable send without session

- Disable send button when no active session exists

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Manohar Gupta 2026-05-11 01:42:37 +05:30
parent 2d61ba2afc
commit fb2527f4b3

View file

@ -161,7 +161,7 @@ export default function AIChatPage() {
className="flex-1 p-3 border rounded-lg"
disabled={loading}
/>
<button onClick={handleSend} disabled={loading} className={`px-4 py-2 text-white rounded-lg ${loading ? "bg-gray-300 cursor-not-allowed" : "bg-rose-400"}`}>
<button onClick={handleSend} disabled={loading || !currentSession} className={`px-4 py-2 text-white rounded-lg ${loading || !currentSession ? "bg-gray-300 cursor-not-allowed" : "bg-rose-400"}`}>
{loading ? "..." : "Send"}
</button>
</div>