mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
fix (sidebar): improve edge case
The initial assumption used to be that we must have a folder entry in the sidebar but this assumption fails when we have a folder with hundreds or more folders in which case we do not display the whole thing and errors would get thrown which from a debugging standpoint was confusing as it would let the dev think there is an uncatch issue
This commit is contained in:
parent
d83638ae95
commit
0f3173a1fe
1 changed files with 5 additions and 9 deletions
|
|
@ -21,11 +21,10 @@ export default async function ctrlNavigationPane(render, { $sidebar, path }) {
|
|||
dirname,
|
||||
});
|
||||
if (cpath === "/") $fs.appendChild($ul);
|
||||
else try {
|
||||
qs($fs, `[data-path="${CSS.escape(cpath)}"] ul`).appendChild($ul);
|
||||
} catch (err) {
|
||||
console.error(chunks[i], dirname, err);
|
||||
break;
|
||||
else {
|
||||
const $menuitem = $fs.querySelector(`[data-path="${CSS.escape(cpath)}"] ul`);
|
||||
if (!$menuitem) break;
|
||||
$menuitem.appendChild($ul);
|
||||
}
|
||||
}
|
||||
render($fs);
|
||||
|
|
@ -46,10 +45,7 @@ export default async function ctrlNavigationPane(render, { $sidebar, path }) {
|
|||
display(await _createListOfFiles(path, {}));
|
||||
}),
|
||||
rxjs.catchError((err) => {
|
||||
if (err instanceof DOMException) {
|
||||
console.error(err);
|
||||
return rxjs.EMPTY;
|
||||
}
|
||||
if (err instanceof DOMException) return rxjs.EMPTY;
|
||||
return ctrlError()(err);
|
||||
}),
|
||||
));
|
||||
|
|
|
|||
Loading…
Reference in a new issue