fixed default template not selected
This commit is contained in:
@@ -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 (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user