Skip to content

Commit

Permalink
chore: add delay before redirect #283
Browse files Browse the repository at this point in the history
  • Loading branch information
srizvi committed Apr 27, 2024
1 parent dc0b9be commit 9785b27
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/mai-sc/src/app/(chat)/chat/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getChat, getMissingKeys } from '#/app/actions';
import { siteConfig } from '#/config/site';
import { AI } from '#/lib/chat/actions';
import { SITE_URL } from '#/lib/constants';
import { sleep } from '#/lib/utils';
import { Chat } from '#/ui/chat';

export interface ChatPageProps {
Expand All @@ -29,6 +30,7 @@ export default async function ChatPage({ params }: ChatPageProps) {
const chat = await getChat(params.id, userId);

if (!chat) {
await sleep(2000);
redirect('/chat');
}

Expand Down

0 comments on commit 9785b27

Please sign in to comment.