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
@@ -171,7 +171,7 @@ function placementNodes(record) {
|
||||
...rooted,
|
||||
...cases.map((item) => ({
|
||||
id: item.case_id,
|
||||
title: item.label.replaceAll("Unterakte ", "").replaceAll("Akte ", "").replaceAll(" → ", " / "),
|
||||
title: String(item.label || "Akte").replaceAll("Unterakte ", "").replaceAll("Akte ", "").replaceAll(" → ", " / "),
|
||||
kind: "Akte",
|
||||
href: `/matters/${record.id}?context_kind=case&context_id=${item.case_id}`,
|
||||
current: false,
|
||||
@@ -328,6 +328,14 @@ export function MatterDetail() {
|
||||
};
|
||||
}, [inherited?.kind, inherited?.id]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!record || record.id !== id || !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, entryId, params, setParams]);
|
||||
|
||||
useEffect(() => {
|
||||
if (entryId) return;
|
||||
restoreScroll(listRef.current, `tsumugu-scroll:${id}:${chapterId}`);
|
||||
@@ -408,10 +416,10 @@ export function MatterDetail() {
|
||||
}));
|
||||
const contexts = (record.placements || []).map((item) => ({
|
||||
id: item.case_id,
|
||||
label: item.label.replaceAll("Unterakte ", "").replaceAll("Akte ", "").replaceAll(" → ", " / "),
|
||||
label: String(item.label || "Akte").replaceAll("Unterakte ", "").replaceAll("Akte ", "").replaceAll(" → ", " / "),
|
||||
}));
|
||||
const contextValue = inherited?.kind === "case" ? inherited.id : (contexts.length === 1 ? contexts[0].id : "");
|
||||
const nodes = caseTree ? caseNodes(caseTree, parentTree, id, inherited.id) : placementNodes(record);
|
||||
const nodes = caseTree && inherited ? caseNodes(caseTree, parentTree, id, inherited.id) : placementNodes(record);
|
||||
const links = [
|
||||
...(record.cross_links || []).map((item) => ({
|
||||
id: `cross-${item.id}`,
|
||||
@@ -435,7 +443,7 @@ export function MatterDetail() {
|
||||
width={width}
|
||||
structureOpen={structureOpen}
|
||||
setStructureOpen={setStructureOpen}
|
||||
hasEntry={Boolean(entryId)}
|
||||
hasEntry={Boolean(entry)}
|
||||
listRef={listRef}
|
||||
nav={(
|
||||
<StructureNavigator
|
||||
@@ -459,7 +467,7 @@ export function MatterDetail() {
|
||||
onClose={width < 1500 ? () => setStructureOpen(false) : null}
|
||||
/>
|
||||
)}
|
||||
reader={entryId ? (
|
||||
reader={entry ? (
|
||||
<ReadingPane
|
||||
binding={entry}
|
||||
context={rightsContext}
|
||||
|
||||
Reference in new issue
Block a user