diff --git a/resources/scripts/components/server/files/FileEditContainer.tsx b/resources/scripts/components/server/files/FileEditContainer.tsx index 87eda2eb5..1faf99e5a 100644 --- a/resources/scripts/components/server/files/FileEditContainer.tsx +++ b/resources/scripts/components/server/files/FileEditContainer.tsx @@ -32,6 +32,7 @@ export default () => { const id = ServerContext.useStoreState(state => state.server.data!.id); const uuid = ServerContext.useStoreState(state => state.server.data!.uuid); + const setDirectory = ServerContext.useStoreActions(actions => actions.files.setDirectory); const { addError, clearFlashes } = useFlash(); let fetchFileContent: null | (() => Promise) = null; @@ -39,8 +40,9 @@ export default () => { useEffect(() => { if (action === 'new') return; - setLoading(true); setError(''); + setLoading(true); + setDirectory(hash.replace(/^#/, '').split('/').filter(v => !!v).slice(0, -1).join('/')); getFileContents(uuid, hash.replace(/^#/, '')) .then(setContent) .catch(error => { diff --git a/resources/scripts/components/server/files/FileManagerBreadcrumbs.tsx b/resources/scripts/components/server/files/FileManagerBreadcrumbs.tsx index 1cdcb05a4..ba43dbd61 100644 --- a/resources/scripts/components/server/files/FileManagerBreadcrumbs.tsx +++ b/resources/scripts/components/server/files/FileManagerBreadcrumbs.tsx @@ -45,13 +45,15 @@ export default ({ withinFileEditor, isNewFile }: Props) => { return (
- {(files && files.length > 0 && !params?.action) && - + {(files && files.length > 0 && !params?.action) ? + + : +
} /home/