mirror of
https://github.com/zadam/trilium.git
synced 2025-11-21 08:04:24 +01:00
chore(print/list): enable print dialog
This commit is contained in:
parent
73e7fa0f85
commit
c95cb79672
@ -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 [ notes, setNotes ] = useState<FNote[]>();
|
||||
|
||||
@ -43,6 +43,12 @@ export function ListPrintView({ note, noteIds: unfilteredNoteIds, highlightedTok
|
||||
froca.getNotes(noteIds).then(setNotes);
|
||||
}, [noteIds]);
|
||||
|
||||
useEffect(() => {
|
||||
if (notes && onReady) {
|
||||
onReady();
|
||||
}
|
||||
}, [ notes, onReady ]);
|
||||
|
||||
return (
|
||||
<div class="note-list list-print-view">
|
||||
<div class="note-list-container use-tn-links">
|
||||
|
||||
@ -49,7 +49,7 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not
|
||||
const canBeConvertedToAttachment = note?.isEligibleForConversionToAttachment();
|
||||
const isSearchable = ["text", "code", "book", "mindMap", "doc"].includes(note.type);
|
||||
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 isMac = getIsMac();
|
||||
const hasSource = ["text", "code", "relationMap", "mermaid", "canvas", "mindMap", "aiChat"].includes(note.type);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user