From e758ae137bcf9ac13de8fd400bd7226fbdb610c6 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Wed, 27 Nov 2024 21:24:48 +0800 Subject: [PATCH] fixL refresh 404 error --- app/(main)/ClientComponents/ServerDetailClient.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/(main)/ClientComponents/ServerDetailClient.tsx b/app/(main)/ClientComponents/ServerDetailClient.tsx index 7f4a10b..b7667ad 100644 --- a/app/(main)/ClientComponents/ServerDetailClient.tsx +++ b/app/(main)/ClientComponents/ServerDetailClient.tsx @@ -43,7 +43,7 @@ export default function ServerDetailClient({ } }; - const { data: allFallbackData } = useSWRImmutable( + const { data: allFallbackData, isLoading } = useSWRImmutable( "/api/server", nezhaFetcher, ); @@ -51,7 +51,7 @@ export default function ServerDetailClient({ (item) => item.id === server_id, ); - if (!fallbackData) { + if (!fallbackData && !isLoading) { notFound(); }