Skip to content

Commit

Permalink
fixed default template not selected
Browse files Browse the repository at this point in the history
  • Loading branch information
marcopiovanello committed Dec 23, 2024
1 parent f9e829d commit fc07c08
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions frontend/src/components/ExtraDownloadOptions.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<>
Expand Down

0 comments on commit fc07c08

Please sign in to comment.