✨ chapter re-ordering
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ipcMain } from 'electron'
|
||||
import { listDraftFiles, readMarkdownFile, writeMarkdownFile, getProjectWordCount } from './fileSystem'
|
||||
import { listDraftFiles, readMarkdownFile, writeMarkdownFile, getProjectWordCount, saveOrderFile } from './fileSystem'
|
||||
import { streamMessage } from './aiService'
|
||||
import type { AIPayload } from '../renderer/types/editor'
|
||||
|
||||
@@ -20,6 +20,10 @@ export function registerIpcHandlers(): void {
|
||||
return await getProjectWordCount()
|
||||
})
|
||||
|
||||
ipcMain.handle('fs:saveOrder', async (_event, order: Record<string, string[]>) => {
|
||||
await saveOrderFile(order)
|
||||
})
|
||||
|
||||
ipcMain.handle('ai:streamMessage', async (event, payload: AIPayload) => {
|
||||
try {
|
||||
await streamMessage(payload, (chunk: string) => {
|
||||
|
||||
Reference in New Issue
Block a user