返回 oh-my-ppt
handlers.ts
根目录 / src / main / io / thumbnails / handlers.ts
1 import { onHtmlThumbnailTaskChanged } from './html-thumbnail-service'
2 import type { IpcContext } from '../../ipc/context'
3
4 export function registerThumbnailHandlers(ctx: IpcContext): void {
5 onHtmlThumbnailTaskChanged((task) => {
6 if (ctx.mainWindow.isDestroyed() || ctx.mainWindow.webContents.isDestroyed()) return
7 ctx.mainWindow.webContents.send('thumbnails:changed', task)
8 })
9 }
10
10 lines TYPESCRIPT