chore(print/list): enable print dialog

This commit is contained in:
Elian Doran 2025-11-20 20:17:20 +02:00
parent 73e7fa0f85
commit c95cb79672
No known key found for this signature in database
2 changed files with 8 additions and 2 deletions

View File

@ -35,7 +35,7 @@ export function ListView({ note, noteIds: unfilteredNoteIds, highlightedTokens }
); );
} }
export function ListPrintView({ note, noteIds: unfilteredNoteIds, highlightedTokens }: ViewModeProps<{}>) { export function ListPrintView({ note, noteIds: unfilteredNoteIds, highlightedTokens, onReady }: ViewModeProps<{}>) {
const noteIds = useFilteredNoteIds(note, unfilteredNoteIds); const noteIds = useFilteredNoteIds(note, unfilteredNoteIds);
const [ notes, setNotes ] = useState<FNote[]>(); const [ notes, setNotes ] = useState<FNote[]>();
@ -43,6 +43,12 @@ export function ListPrintView({ note, noteIds: unfilteredNoteIds, highlightedTok
froca.getNotes(noteIds).then(setNotes); froca.getNotes(noteIds).then(setNotes);
}, [noteIds]); }, [noteIds]);
useEffect(() => {
if (notes && onReady) {
onReady();
}
}, [ notes, onReady ]);
return ( return (
<div class="note-list list-print-view"> <div class="note-list list-print-view">
<div class="note-list-container use-tn-links"> <div class="note-list-container use-tn-links">

View File

@ -49,7 +49,7 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not
const canBeConvertedToAttachment = note?.isEligibleForConversionToAttachment(); const canBeConvertedToAttachment = note?.isEligibleForConversionToAttachment();
const isSearchable = ["text", "code", "book", "mindMap", "doc"].includes(note.type); const isSearchable = ["text", "code", "book", "mindMap", "doc"].includes(note.type);
const isInOptionsOrHelp = note?.noteId.startsWith("_options") || note?.noteId.startsWith("_help"); const isInOptionsOrHelp = note?.noteId.startsWith("_options") || note?.noteId.startsWith("_help");
const isPrintable = ["text", "code"].includes(note.type) || (note.type === "book" && note.getLabelValue("viewType") === "presentation"); const isPrintable = ["text", "code"].includes(note.type) || (note.type === "book" && ["presentation", "list"].includes(note.getLabelValue("viewType") ?? ""));
const isElectron = getIsElectron(); const isElectron = getIsElectron();
const isMac = getIsMac(); const isMac = getIsMac();
const hasSource = ["text", "code", "relationMap", "mermaid", "canvas", "mindMap", "aiChat"].includes(note.type); const hasSource = ["text", "code", "relationMap", "mermaid", "canvas", "mindMap", "aiChat"].includes(note.type);