COrrectly set the breadcrumbs when using browser back; closes #2485
This commit is contained in:
parent
7a0ac1d5c2
commit
6274c451af
|
@ -32,6 +32,7 @@ export default () => {
|
||||||
|
|
||||||
const id = ServerContext.useStoreState(state => state.server.data!.id);
|
const id = ServerContext.useStoreState(state => state.server.data!.id);
|
||||||
const uuid = ServerContext.useStoreState(state => state.server.data!.uuid);
|
const uuid = ServerContext.useStoreState(state => state.server.data!.uuid);
|
||||||
|
const setDirectory = ServerContext.useStoreActions(actions => actions.files.setDirectory);
|
||||||
const { addError, clearFlashes } = useFlash();
|
const { addError, clearFlashes } = useFlash();
|
||||||
|
|
||||||
let fetchFileContent: null | (() => Promise<string>) = null;
|
let fetchFileContent: null | (() => Promise<string>) = null;
|
||||||
|
@ -39,8 +40,9 @@ export default () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (action === 'new') return;
|
if (action === 'new') return;
|
||||||
|
|
||||||
setLoading(true);
|
|
||||||
setError('');
|
setError('');
|
||||||
|
setLoading(true);
|
||||||
|
setDirectory(hash.replace(/^#/, '').split('/').filter(v => !!v).slice(0, -1).join('/'));
|
||||||
getFileContents(uuid, hash.replace(/^#/, ''))
|
getFileContents(uuid, hash.replace(/^#/, ''))
|
||||||
.then(setContent)
|
.then(setContent)
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
|
@ -45,13 +45,15 @@ export default ({ withinFileEditor, isNewFile }: Props) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div css={tw`flex items-center text-sm mb-4 text-neutral-500`}>
|
<div css={tw`flex items-center text-sm mb-4 text-neutral-500`}>
|
||||||
{(files && files.length > 0 && !params?.action) &&
|
{(files && files.length > 0 && !params?.action) ?
|
||||||
<FileActionCheckbox
|
<FileActionCheckbox
|
||||||
type={'checkbox'}
|
type={'checkbox'}
|
||||||
css={tw`mx-4`}
|
css={tw`mx-4`}
|
||||||
checked={selectedFilesLength === (files ? files.length : -1)}
|
checked={selectedFilesLength === (files ? files.length : -1)}
|
||||||
onChange={onSelectAllClick}
|
onChange={onSelectAllClick}
|
||||||
/>
|
/>
|
||||||
|
:
|
||||||
|
<div css={tw`w-12`}/>
|
||||||
}
|
}
|
||||||
/<span css={tw`px-1 text-neutral-300`}>home</span>/
|
/<span css={tw`px-1 text-neutral-300`}>home</span>/
|
||||||
<NavLink
|
<NavLink
|
||||||
|
|
Loading…
Reference in New Issue