diff --git a/frontend/src/components/ExtraDownloadOptions.tsx b/frontend/src/components/ExtraDownloadOptions.tsx index 83dda1f..2dc01da 100644 --- a/frontend/src/components/ExtraDownloadOptions.tsx +++ b/frontend/src/components/ExtraDownloadOptions.tsx @@ -1,13 +1,22 @@ import { Autocomplete, Box, TextField, Typography } from '@mui/material' +import { useAtomValue, useSetAtom } from 'jotai' +import { useEffect } from 'react' import { customArgsState, savedTemplatesState } from '../atoms/downloadTemplate' import { useI18n } from '../hooks/useI18n' -import { useAtom, useAtomValue } from 'jotai' const ExtraDownloadOptions: React.FC = () => { const { i18n } = useI18n() const customTemplates = useAtomValue(savedTemplatesState) - const [, setCustomArgs] = useAtom(customArgsState) + const setCustomArgs = useSetAtom(customArgsState) + + useEffect(() => { + setCustomArgs( + customTemplates + .find(f => f.name.toLocaleLowerCase() === 'default') + ?.content ?? '' + ) + }, []) return ( <>