Skip to content

Commit 70f8067

Browse files
committed
fix: expose rate limit modal only if session is not loading
1 parent 22c1b34 commit 70f8067

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/app/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ export default function Home() {
2222

2323
const [showModal, setShowModal] = useState(false);
2424

25+
// Show the modal only after the search has finished (isLoading → false)
26+
// so it never obscures the live agent workspace or appears before results.
27+
// For instant failures (e.g. 429 rate-limit), isLoading is already false
28+
// when the error is set, so the modal still appears immediately.
2529
useEffect(() => {
26-
if (error) setShowModal(true);
27-
}, [error]);
30+
if (error && !isLoading) setShowModal(true);
31+
}, [error, isLoading]);
2832

2933
const validTickets = tickets.filter((t) => {
3034
const isUnknown = (v: string) => !v || v.toLowerCase() === "unknown";

0 commit comments

Comments
 (0)