Files
Folo/apps/desktop/layer/main/src/lib/dock.ts
T
2025-04-28 21:42:23 +08:00

23 lines
488 B
TypeScript

import { app } from "electron"
import { isWindows } from "../env"
export const setDockCount = (input: number) => {
// TODO use Electron Overlay API
if (isWindows) return
if (app.dock) {
app.dock.setBadge(input === 0 ? "" : input < 10000 ? input.toString() : "9999+")
} else {
app.setBadgeCount(input)
}
}
export const getDockCount = () => {
if (isWindows) return null
if (app.dock) {
return app.dock.getBadge()
} else {
return app.getBadgeCount()
}
}