more dir path fixes

This commit is contained in:
Niklas 2021-08-24 15:59:12 +02:00
parent e06d28d75e
commit fbf1d8e916

View File

@ -113,12 +113,12 @@ const FileBrowser: React.FC = () => {
> >
<div className="flex justify-between"> <div className="flex justify-between">
<Breadcrum path={path} onDirClick={(newPath)=>{ <Breadcrum path={path} onDirClick={(newPath)=>{
setPath(newPath) setPath(normalizeDirPath(newPath))
}}/> }}/>
<div className="ml-auto"> <div className="ml-auto">
<CreateDirButton <CreateDirButton
onPressed={async (dirName)=>{ onPressed={async (dirName)=>{
const fullPath = normalizeDirPath(normalizeDirPath(path) + dirName) const fullPath = normalizeDirPath(path + dirName)
await createDirMutation({variables:{path: fullPath}}) await createDirMutation({variables:{path: fullPath}})
refetchDir() refetchDir()
}} }}
@ -150,7 +150,7 @@ const FileBrowser: React.FC = () => {
key={v?.id} key={v?.id}
dir={v} dir={v}
onClick={(dir)=>{ onClick={(dir)=>{
setPath(dir.id) setPath(normalizeDirPath(dir.id))
}} }}
onContextMenu={(e)=>{ onContextMenu={(e)=>{
openDirContextMenu(e,v.id) openDirContextMenu(e,v.id)