From 5893f1a15feae3bb518f348134d1bed424aa2730 Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Fri, 28 Feb 2025 07:38:48 +0100 Subject: [PATCH] fix: error on hydration and ErrorMessage --- src/app/books/[bookId]/page.tsx | 3 ++- src/app/libraries/[libraryId]/page.tsx | 5 +++-- src/app/page.tsx | 3 +-- src/app/series/[seriesId]/page.tsx | 3 ++- src/components/auth/LoginForm.tsx | 2 +- src/components/auth/RegisterForm.tsx | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/books/[bookId]/page.tsx b/src/app/books/[bookId]/page.tsx index e927795..8f86dcf 100644 --- a/src/app/books/[bookId]/page.tsx +++ b/src/app/books/[bookId]/page.tsx @@ -6,6 +6,7 @@ import { notFound } from "next/navigation"; import { withPageTiming } from "@/lib/hoc/withPageTiming"; import { KomgaBookWithPages } from "@/types/komga"; import { ErrorMessage } from "@/components/ui/ErrorMessage"; +import { ERROR_CODES } from "@/constants/errorCodes"; async function BookPage({ params }: { params: { bookId: string } }) { try { @@ -20,7 +21,7 @@ async function BookPage({ params }: { params: { bookId: string } }) { console.error("Erreur:", error); return (
- +
); } diff --git a/src/app/libraries/[libraryId]/page.tsx b/src/app/libraries/[libraryId]/page.tsx index 63dde01..04fc2a8 100644 --- a/src/app/libraries/[libraryId]/page.tsx +++ b/src/app/libraries/[libraryId]/page.tsx @@ -8,6 +8,7 @@ import { ErrorMessage } from "@/components/ui/ErrorMessage"; import { LibraryResponse } from "@/types/library"; import { KomgaSeries, KomgaLibrary } from "@/types/komga"; import { UserPreferences } from "@/types/preferences"; +import { ERROR_CODES } from "@/constants/errorCodes"; interface PageProps { params: { libraryId: string }; @@ -98,13 +99,13 @@ async function LibraryPage({ params, searchParams }: PageProps) {

Séries

- + ); } return (
- +
); } diff --git a/src/app/page.tsx b/src/app/page.tsx index 8b6fc06..4b2ae32 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -24,7 +24,6 @@ async function refreshHome() { async function HomePage() { try { const data: HomeData = await HomeService.getHomeData(); - return ; } catch (error) { // Si l'erreur indique une configuration manquante, rediriger vers les préférences @@ -34,7 +33,7 @@ async function HomePage() { return (
- +
); } diff --git a/src/app/series/[seriesId]/page.tsx b/src/app/series/[seriesId]/page.tsx index a06d597..57eb5cc 100644 --- a/src/app/series/[seriesId]/page.tsx +++ b/src/app/series/[seriesId]/page.tsx @@ -8,6 +8,7 @@ import { ErrorMessage } from "@/components/ui/ErrorMessage"; import { LibraryResponse } from "@/types/library"; import { KomgaBook, KomgaSeries } from "@/types/komga"; import { UserPreferences } from "@/types/preferences"; +import { ERROR_CODES } from "@/constants/errorCodes"; interface PageProps { params: { seriesId: string }; @@ -78,7 +79,7 @@ async function SeriesPage({ params, searchParams }: PageProps) { return (

Série

- +
); } diff --git a/src/components/auth/LoginForm.tsx b/src/components/auth/LoginForm.tsx index e5f58b7..44c94a6 100644 --- a/src/components/auth/LoginForm.tsx +++ b/src/components/auth/LoginForm.tsx @@ -89,7 +89,7 @@ export function LoginForm({ from }: LoginFormProps) { {t("login.form.remember")} - {error && } + {error && }