fix: parent navigation detaching account in Pro shell file browser

This commit is contained in:
Linus Rath
2026-05-21 18:06:59 +02:00
parent 3540bf42d9
commit c9cda3e203
+8 -1
View File
@@ -491,8 +491,15 @@ export function FileBrowser({
const segments = currentPath.split('/').filter(Boolean);
segments.pop();
const parentPath = segments.length === 0 ? '/' : '/' + segments.join('/');
// Pro shell: going up to root from a subfolder must land on the
// account's filesystem root, not detach back to the account picker.
// Home click (breadcrumb) still detaches.
if (parentPath === '/' && accountLabel) {
onNavigate('/', '__account_root__');
return;
}
onNavigate(parentPath);
}, [currentPath, onNavigate]);
}, [currentPath, onNavigate, accountLabel]);
const handleResourceClick = (resource: FileResource, e: React.MouseEvent) => {
if (resource.isDirectory) {