Require sentry environment variable

This commit is contained in:
Tony Giorgio
2024-06-06 14:41:37 -05:00
committed by Tony Giorgio
parent cf3409120e
commit 0a584e0f44
2 changed files with 4 additions and 6 deletions

View File

@@ -43,8 +43,7 @@ type LoadStage =
export type WalletWorker = Remote<typeof import("../workers/walletWorker")>; export type WalletWorker = Remote<typeof import("../workers/walletWorker")>;
const RELEASE_VERSION = import.meta.env.__RELEASE_VERSION__; const RELEASE_VERSION = import.meta.env.__RELEASE_VERSION__;
const sentryenv = const sentryenv = import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : "");
import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : "prod");
export const makeMegaStoreContext = () => { export const makeMegaStoreContext = () => {
const [searchParams] = useSearchParams(); const [searchParams] = useSearchParams();
@@ -53,7 +52,7 @@ export const makeMegaStoreContext = () => {
localStorage.getItem("report_diagnostics") === "true"; localStorage.getItem("report_diagnostics") === "true";
// initialize both inside worker and outside // initialize both inside worker and outside
if (reportDiagnostics) { if (reportDiagnostics && sentryenv !== "") {
Sentry.init({ Sentry.init({
dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2", dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2",
environment: sentryenv, environment: sentryenv,

View File

@@ -29,8 +29,7 @@ import {
} from "~/routes/settings"; } from "~/routes/settings";
const RELEASE_VERSION = import.meta.env.__RELEASE_VERSION__; const RELEASE_VERSION = import.meta.env.__RELEASE_VERSION__;
const sentryenv = const sentryenv = import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : "");
import.meta.env.VITE_SENTRY_ENVIRONMENT || (DEV ? "dev" : "prod");
// For some reason {...invoice } doesn't bring across the paid field // For some reason {...invoice } doesn't bring across the paid field
function destructureInvoice(invoice: MutinyInvoice): MutinyInvoice { function destructureInvoice(invoice: MutinyInvoice): MutinyInvoice {
@@ -103,7 +102,7 @@ export async function setupMutinyWallet(
nsec?: string nsec?: string
): Promise<boolean> { ): Promise<boolean> {
// initialize both inside worker and outside // initialize both inside worker and outside
if (reportDiagnostics) { if (reportDiagnostics && sentryenv !== "") {
Sentry.init({ Sentry.init({
dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2", dsn: "https://192c556849619517322719962a057376@sen.mutinywallet.com/2",
environment: sentryenv, environment: sentryenv,