refacto: types big review
This commit is contained in:
@@ -42,7 +42,10 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
||||
console.error("Erreur de chargement des bibliothèques:", error);
|
||||
toast({
|
||||
title: "Erreur",
|
||||
description: error instanceof AppError ? error.message : ERROR_MESSAGES[ERROR_CODES.LIBRARY.FETCH_ERROR],
|
||||
description:
|
||||
error instanceof AppError
|
||||
? error.message
|
||||
: ERROR_MESSAGES[ERROR_CODES.LIBRARY.FETCH_ERROR],
|
||||
variant: "destructive",
|
||||
});
|
||||
setLibraries([]);
|
||||
@@ -80,7 +83,10 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
||||
console.error("Erreur de chargement des favoris:", error);
|
||||
toast({
|
||||
title: "Erreur",
|
||||
description: error instanceof AppError ? error.message : ERROR_MESSAGES[ERROR_CODES.FAVORITE.FETCH_ERROR],
|
||||
description:
|
||||
error instanceof AppError
|
||||
? error.message
|
||||
: ERROR_MESSAGES[ERROR_CODES.FAVORITE.FETCH_ERROR],
|
||||
variant: "destructive",
|
||||
});
|
||||
setFavorites([]);
|
||||
@@ -130,7 +136,8 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
||||
console.error("Erreur lors de la déconnexion:", error);
|
||||
toast({
|
||||
title: "Erreur",
|
||||
description: error instanceof AppError ? error.message : ERROR_MESSAGES[ERROR_CODES.AUTH.LOGOUT_ERROR],
|
||||
description:
|
||||
error instanceof AppError ? error.message : ERROR_MESSAGES[ERROR_CODES.AUTH.LOGOUT_ERROR],
|
||||
variant: "destructive",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { KomgaLibrary } from "@/types/komga";
|
||||
import { Book } from "lucide-react";
|
||||
import { Cover } from "@/components/ui/cover";
|
||||
import { KomgaLibrary } from "@/types/komga";
|
||||
|
||||
interface LibraryGridProps {
|
||||
libraries: KomgaLibrary[];
|
||||
|
||||
@@ -9,6 +9,7 @@ import { Cover } from "@/components/ui/cover";
|
||||
import { RefreshButton } from "@/components/library/RefreshButton";
|
||||
import { AppError } from "@/utils/errors";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { ERROR_MESSAGES } from "@/constants/errorMessages";
|
||||
|
||||
interface SeriesHeaderProps {
|
||||
series: KomgaSeries;
|
||||
@@ -32,7 +33,10 @@ export const SeriesHeader = ({ series, refreshSeries }: SeriesHeaderProps) => {
|
||||
console.error("Erreur lors de la vérification des favoris:", error);
|
||||
toast({
|
||||
title: "Erreur",
|
||||
description: error instanceof AppError ? error.message : ERROR_MESSAGES[ERROR_CODES.FAVORITE.NETWORK_ERROR],
|
||||
description:
|
||||
error instanceof AppError
|
||||
? error.message
|
||||
: ERROR_MESSAGES[ERROR_CODES.FAVORITE.NETWORK_ERROR],
|
||||
variant: "destructive",
|
||||
});
|
||||
}
|
||||
@@ -71,7 +75,10 @@ export const SeriesHeader = ({ series, refreshSeries }: SeriesHeaderProps) => {
|
||||
console.error("Erreur lors de la modification des favoris:", error);
|
||||
toast({
|
||||
title: "Erreur",
|
||||
description: error instanceof AppError ? error.message : ERROR_MESSAGES[ERROR_CODES.FAVORITE.NETWORK_ERROR],
|
||||
description:
|
||||
error instanceof AppError
|
||||
? error.message
|
||||
: ERROR_MESSAGES[ERROR_CODES.FAVORITE.NETWORK_ERROR],
|
||||
variant: "destructive",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,23 +9,7 @@ import { usePreferences } from "@/contexts/PreferencesContext";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { CacheModeSwitch } from "@/components/settings/CacheModeSwitch";
|
||||
|
||||
interface KomgaConfig {
|
||||
url: string;
|
||||
username: string;
|
||||
userId: string;
|
||||
password?: string;
|
||||
authHeader: string;
|
||||
}
|
||||
|
||||
interface TTLConfigData {
|
||||
defaultTTL: number;
|
||||
homeTTL: number;
|
||||
librariesTTL: number;
|
||||
seriesTTL: number;
|
||||
booksTTL: number;
|
||||
imagesTTL: number;
|
||||
}
|
||||
import { KomgaConfig, TTLConfigData } from "@/types/komga";
|
||||
|
||||
interface ClientSettingsProps {
|
||||
initialConfig: KomgaConfig | null;
|
||||
|
||||
Reference in New Issue
Block a user