From 8a2a90e9ef7893d3e85989f473ac09365bfde4d3 Mon Sep 17 00:00:00 2001 From: Leo dev Date: Wed, 5 Nov 2025 23:24:20 +0100 Subject: [PATCH] User not found #30 --- src/app/chat/[id]/page.tsx | 23 ++++++++++++++++++++--- src/app/chat/page.tsx | 4 ++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/app/chat/[id]/page.tsx b/src/app/chat/[id]/page.tsx index 340d749..69b9284 100644 --- a/src/app/chat/[id]/page.tsx +++ b/src/app/chat/[id]/page.tsx @@ -2,17 +2,19 @@ import MessageBox from "@/components/MessageBox"; import AppLayout from "@/components/app/AppLayout"; -import { useParams } from "next/navigation"; +import { useParams, useRouter } from "next/navigation"; import useApp from "@/hooks/use-app"; import { useEffect, useRef } from "react"; import auth from "@/lib/auth"; import useAsync from "@/hooks/use-async"; +import { Button } from "@/components/ui/button"; export default function DMs() { const { id } = useParams<{ id: string }>(); const app = useApp(); const targetNode = useRef(null); - const { value: target } = useAsync(() => app.getUserById(id)); + const { value: target, loading } = useAsync(() => app.getUserById(id)); + const router = useRouter(); useEffect(() => { async function connectTargetNode() { @@ -29,7 +31,7 @@ export default function DMs() { connectTargetNode(); }, [target]); - return ( + return loading || target ? ( + ) : ( +
+

+ 404 +

+
+ User Not Found +
+

+ Sorry, we couldn't find the user you're looking for. +

+ +
); } diff --git a/src/app/chat/page.tsx b/src/app/chat/page.tsx index b9ab8d1..f6a639b 100644 --- a/src/app/chat/page.tsx +++ b/src/app/chat/page.tsx @@ -34,7 +34,7 @@ export default function ChatHub() { const activeServers: Server[] = Object.values(app.servers).slice(0, 3); const trendingServers: Server[] = [ { - id: "cee6b20f-7e6a-4071-8df1-aab37f52bbb9", + id: "orus", name: "ORUS", icon_url: "https://github.com/orus-dev.png", channels: [], @@ -46,7 +46,7 @@ export default function ChatHub() { channels: [], }, { - id: "cee6b20f-7e6a-4071-8df1-aab37f52bbb9", + id: "osui", name: "OSUI Rust Hub", icon_url: "https://github.com/osui-rs.png", channels: [],