Initial commit

This commit is contained in:
AnRil
2026-05-16 13:43:29 +07:00
commit 688a86b611
208 changed files with 44350 additions and 0 deletions

19
src/main/state-actions.ts Normal file
View File

@@ -0,0 +1,19 @@
import { BrowserWindow } from 'electron'
import { IPC } from '@shared/ipc'
import { getExercises, getState, updateExercise } from './store'
export function broadcastState(): void {
const state = getState()
for (const win of BrowserWindow.getAllWindows()) {
if (!win.isDestroyed()) win.webContents.send(IPC.evtStateChanged, state)
}
}
export function snoozeAll(minutes: number): void {
const now = Date.now()
for (const ex of getExercises()) {
if (!ex.enabled) continue
updateExercise(ex.id, { nextFireAt: now + minutes * 60_000 })
}
broadcastState()
}