mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-31 21:43:19 +00:00
Merge pull request #4163 from overleaf/ae-handle-import-from-project-errors
Display a message if there's an error loading the list of projects/files/entities GitOrigin-RevId: dae3ab2b5f33d3c286064dec05567a80cbc23a0e
This commit is contained in:
parent
c0d3b776e2
commit
3020999924
1 changed files with 15 additions and 6 deletions
|
@ -155,8 +155,7 @@ export default function FileTreeImportFromProject() {
|
|||
function SelectProject({ projectId, selectedProject, setSelectedProject }) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
// NOTE: unhandled error
|
||||
const { data, loading } = useUserProjects()
|
||||
const { data, error, loading } = useUserProjects()
|
||||
|
||||
const filteredData = useMemo(() => {
|
||||
if (!data) {
|
||||
|
@ -166,6 +165,10 @@ function SelectProject({ projectId, selectedProject, setSelectedProject }) {
|
|||
return data.filter(item => item._id !== projectId)
|
||||
}, [data, projectId])
|
||||
|
||||
if (error) {
|
||||
return <ErrorMessage error={error} />
|
||||
}
|
||||
|
||||
return (
|
||||
<FormGroup className="form-controls" controlId="project-select">
|
||||
<ControlLabel>{t('select_a_project')}</ControlLabel>
|
||||
|
@ -218,8 +221,11 @@ function SelectProjectOutputFile({
|
|||
}) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
// NOTE: unhandled error
|
||||
const { data, loading } = useProjectOutputFiles(selectedProjectId)
|
||||
const { data, error, loading } = useProjectOutputFiles(selectedProjectId)
|
||||
|
||||
if (error) {
|
||||
return <ErrorMessage error={error} />
|
||||
}
|
||||
|
||||
return (
|
||||
<FormGroup
|
||||
|
@ -272,8 +278,11 @@ function SelectProjectEntity({
|
|||
}) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
// NOTE: unhandled error
|
||||
const { data, loading } = useProjectEntities(selectedProjectId)
|
||||
const { data, error, loading } = useProjectEntities(selectedProjectId)
|
||||
|
||||
if (error) {
|
||||
return <ErrorMessage error={error} />
|
||||
}
|
||||
|
||||
return (
|
||||
<FormGroup
|
||||
|
|
Loading…
Reference in a new issue