Files
Folo/src/main/init.ts
T
Innei 2efb3a7086 feat: sentry integration and nice error element (#119)
* init

Signed-off-by: Innei <i@innei.in>

* sentry init

Signed-off-by: Innei <i@innei.in>

* update

Signed-off-by: Innei <i@innei.in>

* feat: sentry config

Signed-off-by: Innei <i@innei.in>

* feat: nice error element

Signed-off-by: Innei <i@innei.in>

---------

Signed-off-by: Innei <i@innei.in>
2024-07-09 23:33:22 +08:00

37 lines
868 B
TypeScript

import path from "node:path"
import { registerIpcMain } from "@egoist/tipc/main"
import * as Sentry from "@sentry/electron/main"
import { app } from "electron"
import { getIconPath } from "./helper"
import { registerAppMenu } from "./menu"
import { router } from "./tipc"
const appFolder = {
prod: "Follow",
dev: "Follow (dev)",
}
const isDev = process.env.NODE_ENV === "development"
export const initializationApp = () => {
Sentry.init({
dsn: process.env.VITE_SENTRY_DSN,
})
registerIpcMain(router)
app.setPath(
"appData",
path.join(app.getPath("appData"), isDev ? appFolder.dev : appFolder.prod),
)
if (app.dock) {
app.dock.setIcon(getIconPath())
}
// In this file you can include the rest of your app"s specific main process
// code. You can also put them in separate files and require them here.
registerAppMenu()
}