mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Disable the file tree "create file" name input while a request is in flight (#18001)
GitOrigin-RevId: ef505220e8cff1dce4c84483edacd96cc87bb1aa
This commit is contained in:
+2
-2
@@ -9,7 +9,7 @@ import ErrorMessage from '../error-message'
|
||||
export default function FileTreeCreateNewDoc() {
|
||||
const { name, validName } = useFileTreeCreateName()
|
||||
const { setValid } = useFileTreeCreateForm()
|
||||
const { error, finishCreatingDoc } = useFileTreeActionable()
|
||||
const { error, finishCreatingDoc, inFlight } = useFileTreeActionable()
|
||||
|
||||
// form validation: name is valid
|
||||
useEffect(() => {
|
||||
@@ -32,7 +32,7 @@ export default function FileTreeCreateNewDoc() {
|
||||
|
||||
return (
|
||||
<form noValidate id="create-file" onSubmit={handleSubmit}>
|
||||
<FileTreeCreateNameInput focusName error={error} />
|
||||
<FileTreeCreateNameInput focusName error={error} inFlight={inFlight} />
|
||||
|
||||
{error && <ErrorMessage error={error} />}
|
||||
</form>
|
||||
|
||||
+2
-1
@@ -31,7 +31,7 @@ export default function FileTreeImportFromProject() {
|
||||
|
||||
const { name, setName, validName } = useFileTreeCreateName()
|
||||
const { setValid } = useFileTreeCreateForm()
|
||||
const { error, finishCreatingLinkedFile } = useFileTreeActionable()
|
||||
const { error, finishCreatingLinkedFile, inFlight } = useFileTreeActionable()
|
||||
|
||||
const [selectedProject, setSelectedProject] = useState<Project>()
|
||||
const [selectedProjectEntity, setSelectedProjectEntity] = useState<Entity>()
|
||||
@@ -168,6 +168,7 @@ export default function FileTreeImportFromProject() {
|
||||
}}
|
||||
placeholder="example.tex"
|
||||
error={error}
|
||||
inFlight={inFlight}
|
||||
/>
|
||||
|
||||
{error && <ErrorMessage error={error} />}
|
||||
|
||||
+2
-1
@@ -12,7 +12,7 @@ export default function FileTreeImportFromUrl() {
|
||||
const { t } = useTranslation()
|
||||
const { name, setName, validName } = useFileTreeCreateName()
|
||||
const { setValid } = useFileTreeCreateForm()
|
||||
const { finishCreatingLinkedFile, error } = useFileTreeActionable()
|
||||
const { finishCreatingLinkedFile, error, inFlight } = useFileTreeActionable()
|
||||
|
||||
const [url, setUrl] = useState('')
|
||||
|
||||
@@ -70,6 +70,7 @@ export default function FileTreeImportFromUrl() {
|
||||
label={t('file_name_in_this_project')}
|
||||
placeholder="my_file"
|
||||
error={error}
|
||||
inFlight={inFlight}
|
||||
/>
|
||||
|
||||
{error && <ErrorMessage error={error} />}
|
||||
|
||||
Reference in New Issue
Block a user