Schließe den Leser, wenn eine entfernte Datei die Navigation ausblendet.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
79241831fd
commit
562c0848b1
5 files changed
+104
-35
No files matched your search
@@ -209,12 +209,12 @@ function chapterOrigin(base, chapters, chapterId) {
|
||||
|
||||
function mergedCaseItems(record, direction, caseId) {
|
||||
const rows = [
|
||||
...(record.bindings || []).map((binding) => ({
|
||||
...(record.bindings || []).filter((binding) => binding?.element).map((binding) => ({
|
||||
...binding,
|
||||
origin: chapterOrigin("Direkt in dieser Akte", record.chapters, binding.chapter_id),
|
||||
readerHref: `/cases/${caseId}?eintrag=${binding.id}${binding.chapter_id ? `&kapitel=${binding.chapter_id}` : ""}`,
|
||||
})),
|
||||
...(record.contained || []).flatMap((group) => (group.bindings || []).map((binding) => ({
|
||||
...(record.contained || []).flatMap((group) => (group.bindings || []).filter((binding) => binding?.element).map((binding) => ({
|
||||
...binding,
|
||||
origin: chapterOrigin(matterOrigin(group), group.chapters, binding.chapter_id),
|
||||
readerHref: `/matters/${group.matter_id}?context_kind=case&context_id=${caseId}&eintrag=${binding.id}${binding.chapter_id ? `&kapitel=${binding.chapter_id}` : ""}`,
|
||||
@@ -396,6 +396,14 @@ export function CaseDetail() {
|
||||
}
|
||||
}, [record, id, rawScope, overview, chapterId, params, setParams, navigate]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!record || record.id !== id || overview || !entryId) return;
|
||||
if ((record.bindings || []).some((item) => item.id === entryId)) return;
|
||||
const updated = new URLSearchParams(params);
|
||||
updated.delete("eintrag");
|
||||
setParams(updated, { replace: true });
|
||||
}, [record, id, overview, entryId, params, setParams]);
|
||||
|
||||
useEffect(() => {
|
||||
if (entryId) return;
|
||||
restoreScroll(listRef.current, `tsumugu-scroll:case:${id}:${chapterId}:${overview ? "over" : "direct"}`);
|
||||
@@ -486,7 +494,7 @@ export function CaseDetail() {
|
||||
width={width}
|
||||
structureOpen={structureOpen}
|
||||
setStructureOpen={setStructureOpen}
|
||||
hasEntry={Boolean(entryId) && !overview}
|
||||
hasEntry={Boolean(entry) && !overview}
|
||||
listRef={listRef}
|
||||
nav={(
|
||||
<StructureNavigator
|
||||
@@ -511,7 +519,7 @@ export function CaseDetail() {
|
||||
onClose={width < 1500 ? () => setStructureOpen(false) : null}
|
||||
/>
|
||||
)}
|
||||
reader={entryId && !overview ? (
|
||||
reader={entry ? (
|
||||
<ReadingPane
|
||||
binding={entry}
|
||||
context={context}
|
||||
|
||||
Reference in new issue
Block a user