1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-19 20:31:46 +02:00

Desktop: Fix PDF export fails with error (#11390)

This commit is contained in:
Henry Heino 2024-11-14 01:06:33 -08:00 committed by GitHub
parent 11b33474b7
commit 9a5842c621
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,14 +4,14 @@ import InteropServiceHelper from '../../../InteropServiceHelper';
import { _ } from '@joplin/lib/locale';
import Note from '@joplin/lib/models/Note';
import bridge from '../../../services/bridge';
import { WindowControl } from '../utils/useWindowControl';
export const declaration: CommandDeclaration = {
name: 'exportPdf',
label: () => `PDF - ${_('PDF File')}`,
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
export const runtime = (comp: any): CommandRuntime => {
export const runtime = (comp: WindowControl): CommandRuntime => {
return {
execute: async (context: CommandContext, noteIds: string[] = null) => {
try {
@ -53,7 +53,7 @@ export const runtime = (comp: any): CommandRuntime => {
pdfPath = await shim.fsDriver().findUniqueFilename(`${path}/${n}`);
}
await comp.printTo_('pdf', { path: pdfPath, noteId: note.id });
await comp.printTo('pdf', { path: pdfPath, noteId: note.id });
}
} catch (error) {
console.error(error);