diff --git a/src/apps/dashboard/features/logs/api/useServerLog.ts b/src/apps/dashboard/features/logs/api/useServerLog.ts index c3794bf182..4182f9f78d 100644 --- a/src/apps/dashboard/features/logs/api/useServerLog.ts +++ b/src/apps/dashboard/features/logs/api/useServerLog.ts @@ -5,20 +5,14 @@ import { useApi } from 'hooks/useApi'; import type { AxiosRequestConfig } from 'axios'; const fetchServerLog = async ( - api?: Api, - name?: string, + api: Api | undefined, + name: string, options?: AxiosRequestConfig ) => { if (!api) { console.error('[useServerLog] No API instance available'); return; } - - if (!name) { - console.error('[useServerLog] Name is required'); - return; - } - const response = await getSystemApi(api).getLogFile({ name }, options); // FIXME: TypeScript SDK thinks it is returning a File but in reality it is a string diff --git a/src/apps/dashboard/routes/logs/file.tsx b/src/apps/dashboard/routes/logs/file.tsx index 25b7e492f1..80cfd99934 100644 --- a/src/apps/dashboard/routes/logs/file.tsx +++ b/src/apps/dashboard/routes/logs/file.tsx @@ -15,6 +15,7 @@ import { } from '@mui/material'; import { ContentCopy, FileDownload } from '@mui/icons-material'; import globalize from 'lib/globalize'; +import toast from 'components/toast/toast'; export const Component = () => { const { file: fileName } = useParams(); @@ -30,6 +31,7 @@ export const Component = () => { const copyToClipboard = useCallback(async () => { if ('clipboard' in navigator && log) { await navigator.clipboard.writeText(log); + toast({ text: globalize.translate('CopyLogSuccess') }); } }, [log]); diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 576de0abd8..ff73246005 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -188,6 +188,7 @@ "CopyFailed": "Could not copy", "CopyStreamURL": "Copy Stream URL", "CopyStreamURLSuccess": "URL copied successfully.", + "CopyLogSuccess": "Log contents copied successfully.", "CoverArtist": "Cover artist", "Creator": "Creator", "CriticRating": "Critics rating",