d4122c8f95
Add pomodoro timer with goal notifications, writing streak milestones, and knowledge injection logging with UI previews across AI writing flows. Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
692 B
TypeScript
15 lines
692 B
TypeScript
import { ipcMain } from 'electron'
|
|
import { IPC } from '../../../shared/ipc-channels'
|
|
import type { PomodoroService } from '../../services/pomodoro.service'
|
|
import { wrap } from '../result'
|
|
|
|
export function registerPomodoroHandlers(pomodoro: PomodoroService): void {
|
|
ipcMain.handle(IPC.POMODORO_START, (_e, { bookId }: { bookId: string }) =>
|
|
wrap(() => pomodoro.start(bookId))
|
|
)
|
|
ipcMain.handle(IPC.POMODORO_PAUSE, () => wrap(() => pomodoro.pause()))
|
|
ipcMain.handle(IPC.POMODORO_RESUME, () => wrap(() => pomodoro.resume()))
|
|
ipcMain.handle(IPC.POMODORO_CANCEL, () => wrap(() => pomodoro.cancel()))
|
|
ipcMain.handle(IPC.POMODORO_GET_STATE, () => wrap(() => pomodoro.getState()))
|
|
}
|