Skip to content

Commit c95cb79

Browse files
committed
chore(print/list): enable print dialog
1 parent 73e7fa0 commit c95cb79

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

apps/client/src/widgets/collections/legacy/ListOrGridView.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,20 @@ export function ListView({ note, noteIds: unfilteredNoteIds, highlightedTokens }
3535
);
3636
}
3737

38-
export function ListPrintView({ note, noteIds: unfilteredNoteIds, highlightedTokens }: ViewModeProps<{}>) {
38+
export function ListPrintView({ note, noteIds: unfilteredNoteIds, highlightedTokens, onReady }: ViewModeProps<{}>) {
3939
const noteIds = useFilteredNoteIds(note, unfilteredNoteIds);
4040
const [ notes, setNotes ] = useState<FNote[]>();
4141

4242
useEffect(() => {
4343
froca.getNotes(noteIds).then(setNotes);
4444
}, [noteIds]);
4545

46+
useEffect(() => {
47+
if (notes && onReady) {
48+
onReady();
49+
}
50+
}, [ notes, onReady ]);
51+
4652
return (
4753
<div class="note-list list-print-view">
4854
<div class="note-list-container use-tn-links">

apps/client/src/widgets/ribbon/NoteActions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not
4949
const canBeConvertedToAttachment = note?.isEligibleForConversionToAttachment();
5050
const isSearchable = ["text", "code", "book", "mindMap", "doc"].includes(note.type);
5151
const isInOptionsOrHelp = note?.noteId.startsWith("_options") || note?.noteId.startsWith("_help");
52-
const isPrintable = ["text", "code"].includes(note.type) || (note.type === "book" && note.getLabelValue("viewType") === "presentation");
52+
const isPrintable = ["text", "code"].includes(note.type) || (note.type === "book" && ["presentation", "list"].includes(note.getLabelValue("viewType") ?? ""));
5353
const isElectron = getIsElectron();
5454
const isMac = getIsMac();
5555
const hasSource = ["text", "code", "relationMap", "mermaid", "canvas", "mindMap", "aiChat"].includes(note.type);

0 commit comments

Comments
 (0)