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,
|
dirname,
|
||||||
});
|
});
|
||||||
if (cpath === "/") $fs.appendChild($ul);
|
if (cpath === "/") $fs.appendChild($ul);
|
||||||
else try {
|
else {
|
||||||
qs($fs, `[data-path="${CSS.escape(cpath)}"] ul`).appendChild($ul);
|
const $menuitem = $fs.querySelector(`[data-path="${CSS.escape(cpath)}"] ul`);
|
||||||
} catch (err) {
|
if (!$menuitem) break;
|
||||||
console.error(chunks[i], dirname, err);
|
$menuitem.appendChild($ul);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
render($fs);
|
render($fs);
|
||||||
|
|
@ -46,10 +45,7 @@ export default async function ctrlNavigationPane(render, { $sidebar, path }) {
|
||||||
display(await _createListOfFiles(path, {}));
|
display(await _createListOfFiles(path, {}));
|
||||||
}),
|
}),
|
||||||
rxjs.catchError((err) => {
|
rxjs.catchError((err) => {
|
||||||
if (err instanceof DOMException) {
|
if (err instanceof DOMException) return rxjs.EMPTY;
|
||||||
console.error(err);
|
|
||||||
return rxjs.EMPTY;
|
|
||||||
}
|
|
||||||
return ctrlError()(err);
|
return ctrlError()(err);
|
||||||
}),
|
}),
|
||||||
));
|
));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue