feat: export page as file (#2923)

This commit is contained in:
xiaodong zuo
2023-06-30 05:58:02 +08:00
committed by GitHub
parent 8a7908c692
commit bc3ce7395e
4 changed files with 121 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
import { BrowserWindow, dialog, shell } from 'electron';
import { BrowserWindow, dialog } from 'electron';
import fs from 'fs-extra';
import { logger } from '../logger';
@@ -49,8 +49,6 @@ export async function savePDFFileAs(
logger.log(`Wrote PDF successfully to ${filePath}`);
});
});
await shell.openPath(filePath);
return { filePath };
} catch (err) {
logger.error('savePDFFileAs', err);

View File

@@ -1,6 +1,7 @@
import { Content, displayFlex } from '@affine/component';
import { AffineWatermark } from '@affine/component/affine-watermark';
import { appSidebarResizingAtom } from '@affine/component/app-sidebar';
import { NotificationCenter } from '@affine/component/notification-center';
import type { DraggableTitleCellData } from '@affine/component/page-list';
import { StyledTitleLink } from '@affine/component/page-list';
import {
@@ -444,6 +445,7 @@ export const WorkspaceLayoutInner: FC<PropsWithChildren> = ({ children }) => {
<PageListTitleCellDragOverlay />
</DndContext>
<QuickSearch />
<NotificationCenter />
<Setting />
</>
);