sentry environment

This commit is contained in:
neil molina 2023-05-09 16:55:50 +08:00
parent f1d9433fa1
commit 2f741d0bdb
No known key found for this signature in database
GPG key ID: 52D69BF1F02F4267
3 changed files with 10 additions and 2 deletions

View file

@ -17,9 +17,14 @@ import initializePushNotification, {
import init from "./libs/initialize"; import init from "./libs/initialize";
import { readSessionData } from "./libs/auth"; import { readSessionData } from "./libs/auth";
import { isDev } from "./libs/auto-updater";
log.info("App starting..."); log.info("App starting...");
if (app.isPackaged) { if (app.isPackaged) {
const dev = isDev();
Sentry.init({ Sentry.init({
environment: dev ? "development" : "production",
dsn: "https://5ff29bb5b3b64cd4bd4f4960ef1db2e3@o4504750197899264.ingest.sentry.io/4504750206746624", dsn: "https://5ff29bb5b3b64cd4bd4f4960ef1db2e3@o4504750197899264.ingest.sentry.io/4504750206746624",
debug: true, debug: true,
release: app.getVersion(), release: app.getVersion(),

View file

@ -1,6 +1,6 @@
{ {
"name": "tea", "name": "tea",
"version": "0.1.5", "version": "0.2.0",
"private": true, "private": true,
"description": "tea gui app", "description": "tea gui app",
"author": "tea.xyz", "author": "tea.xyz",

View file

@ -1,10 +1,13 @@
import * as Sentry from "@sentry/browser"; import * as Sentry from "@sentry/browser";
import type { Session } from "./types"; import type { Session } from "./types";
import { isPackaged } from "electron-is-packaged"; import { isPackaged } from "electron-is-packaged";
import { isDev } from "@native";
export function initSentry(session?: Session) { export async function initSentry(session?: Session) {
if (isPackaged) { if (isPackaged) {
const dev = await isDev();
Sentry.init({ Sentry.init({
environment: dev ? "development" : "production",
dsn: "https://5ff29bb5b3b64cd4bd4f4960ef1db2e3@o4504750197899264.ingest.sentry.io/4504750206746624" dsn: "https://5ff29bb5b3b64cd4bd4f4960ef1db2e3@o4504750197899264.ingest.sentry.io/4504750206746624"
}); });
if (session) { if (session) {