Skip to content

Commit 7b689da

Browse files
committed
roomがない時のエラーメッセージを変更
1 parent 4be12a6 commit 7b689da

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

web/app/chat/[id]/page.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22
import type { DMRoom, PersonalizedDMRoom } from "common/types";
3+
import Link from "next/link";
34
import { useEffect, useState } from "react";
45
import * as chat from "~/api/chat/chat";
56
import { RoomWindow } from "~/components/chat/RoomWindow";
@@ -16,8 +17,16 @@ export default function Page({ params }: { params: { id: string } }) {
1617

1718
return (
1819
<>
19-
<p>idは{id}です。</p>
20-
{room ? <RoomWindow friendId={id} room={room} /> : <p>データないよ</p>}
20+
{room ? (
21+
<RoomWindow friendId={id} room={room} />
22+
) : (
23+
<p>
24+
Sorry, an unexpected error has occurred.
25+
<Link href="/home" className="text-blue-600">
26+
Go Back
27+
</Link>
28+
</p>
29+
)}
2130
</>
2231
);
2332
}

0 commit comments

Comments
 (0)