new changes

This commit is contained in:
Niranjan
2026-04-07 05:26:12 +05:30
parent 60e8d457c4
commit b679cc3bb5
2 changed files with 53 additions and 26 deletions

View File

@@ -58,7 +58,7 @@ export function FilesPage() {
const handleBack = () => {
const parts = path.replace(/\/$/, '').split('/').filter(Boolean)
if (parts.length <= 1) return
if (parts.length === 0) return
parts.pop()
const newPath = parts.length === 0 ? '/' : '/' + parts.join('/')
loadDir(newPath)
@@ -147,8 +147,8 @@ export function FilesPage() {
.catch((err) => setError(err.message))
}
const breadcrumbs = path.split('/').filter(Boolean)
const canGoBack = breadcrumbs.length > 0
const pathSegments = path.replace(/\/$/, '').split('/').filter(Boolean)
const canGoBack = pathSegments.length > 0
return (
<>
@@ -172,7 +172,7 @@ export function FilesPage() {
)}
Upload
</AdminButton>
<code className="small bg-body-secondary px-2 py-1 rounded ms-auto text-break">Path: {path}</code>
<code className="small bg-body-secondary px-2 py-1 rounded ms-auto text-break">Path: {path || '/'}</code>
</div>
<Modal show={showMkdir} onHide={() => { setShowMkdir(false); setMkdirName('') }} centered>