diff --git a/src/client/components/Dashboard/RecentlyImported.tsx b/src/client/components/Dashboard/RecentlyImported.tsx index f6438b4..aa2e141 100644 --- a/src/client/components/Dashboard/RecentlyImported.tsx +++ b/src/client/components/Dashboard/RecentlyImported.tsx @@ -131,12 +131,6 @@ export const RecentlyImported = ( )} - {/* Raw file presence */} - {isMissingFile && ( - - - - )} diff --git a/src/client/components/Import/RealTimeImportStats.tsx b/src/client/components/Import/RealTimeImportStats.tsx index 0e946ac..089103c 100644 --- a/src/client/components/Import/RealTimeImportStats.tsx +++ b/src/client/components/Import/RealTimeImportStats.tsx @@ -4,7 +4,7 @@ import { useQueryClient } from "@tanstack/react-query"; import { useGetImportStatisticsQuery, useGetWantedComicsQuery, - useStartIncrementalImportMutation + useStartIncrementalImportMutation, } from "../../graphql/generated"; import { useStore } from "../../store"; import { useShallow } from "zustand/react/shallow"; @@ -25,12 +25,12 @@ export const RealTimeImportStats = (): ReactElement => { getSocket: state.getSocket, disconnectSocket: state.disconnectSocket, importJobQueue: state.importJobQueue, - })) + })), ); const { data: importStats, isLoading } = useGetImportStatisticsQuery( {}, - { refetchOnWindowFocus: false, refetchInterval: false } + { refetchOnWindowFocus: false, refetchInterval: false }, ); const stats = importStats?.getImportStatistics?.stats; @@ -45,7 +45,7 @@ export const RealTimeImportStats = (): ReactElement => { refetchOnWindowFocus: false, refetchInterval: false, enabled: (stats?.missingFiles ?? 0) > 0, - } + }, ); const missingDocs = missingComicsData?.getComicBooks?.docs ?? []; @@ -64,17 +64,20 @@ export const RealTimeImportStats = (): ReactElement => { const importSession = useImportSessionStatus(); - const { mutate: startIncrementalImport, isPending: isStartingImport } = useStartIncrementalImportMutation({ - onSuccess: (data) => { - if (data.startIncrementalImport.success) { - importJobQueue.setStatus("running"); - setImportError(null); - } - }, - onError: (error: any) => { - setImportError(error?.message || "Failed to start import. Please try again."); - }, - }); + const { mutate: startIncrementalImport, isPending: isStartingImport } = + useStartIncrementalImportMutation({ + onSuccess: (data) => { + if (data.startIncrementalImport.success) { + importJobQueue.setStatus("running"); + setImportError(null); + } + }, + onError: (error: any) => { + setImportError( + error?.message || "Failed to start import. Please try again.", + ); + }, + }); const hasNewFiles = stats && stats.newFiles > 0; const missingCount = stats?.missingFiles ?? 0; @@ -113,7 +116,7 @@ export const RealTimeImportStats = (): ReactElement => { if (importSession.isActive) { setImportError( - `Cannot start import: An import session "${importSession.sessionId}" is already active. Please wait for it to complete.` + `Cannot start import: An import session "${importSession.sessionId}" is already active. Please wait for it to complete.`, ); return; } @@ -148,7 +151,9 @@ export const RealTimeImportStats = (): ReactElement => { const hasSessionStats = importSession.isActive && sessionStats !== null; const totalFiles = stats.totalLocalFiles; - const importedCount = hasSessionStats ? sessionStats!.filesSucceeded : stats.alreadyImported; + const importedCount = hasSessionStats + ? sessionStats!.filesSucceeded + : stats.alreadyImported; const failedCount = hasSessionStats ? sessionStats!.filesFailed : 0; const showProgressBar = importSession.isActive; @@ -165,8 +170,12 @@ export const RealTimeImportStats = (): ReactElement => {
-

Import Error

-

{importError}

+

+ Import Error +

+

+ {importError} +