fix(mobile): fixed tree for launcher duplicated in split

This commit is contained in:
Elian Doran 2026-02-04 18:52:46 +02:00
parent 3e54d0ceae
commit 8aa4a97480
No known key found for this signature in database

View File

@ -38,7 +38,7 @@ export default function NoteDetail() {
const [ noteTypesToRender, setNoteTypesToRender ] = useState<{ [ key in ExtendedNoteType ]?: (props: TypeWidgetProps) => VNode }>({});
const [ activeNoteType, setActiveNoteType ] = useState<ExtendedNoteType>();
const widgetRequestId = useRef(0);
const hasFixedTree = noteContext?.hoistedNoteId === "_lbMobileRoot" && isMobile();
const hasFixedTree = note && noteContext?.hoistedNoteId === "_lbMobileRoot" && isMobile() && note.noteId.startsWith("_lbMobile");
const props: TypeWidgetProps = {
note: note!,
@ -216,7 +216,7 @@ export default function NoteDetail() {
"fixed-tree": hasFixedTree
})}
>
{hasFixedTree && <FixedTree />}
{hasFixedTree && <FixedTree noteContext={noteContext} />}
{Object.entries(noteTypesToRender).map(([ itemType, Element ]) => {
return <NoteDetailWrapper
@ -232,8 +232,7 @@ export default function NoteDetail() {
);
}
function FixedTree() {
const { noteContext } = useNoteContext();
function FixedTree({ noteContext }: { noteContext: NoteContext }) {
const [ treeEl ] = useLegacyWidget(() => new NoteTreeWidget(), { noteContext });
return <div class="fixed-note-tree-container">{treeEl}</div>;
}