Skip to content

Commit

Permalink
fix: fixed analytics and error logging not working
Browse files Browse the repository at this point in the history
  • Loading branch information
The24thDS committed Sep 1, 2023
1 parent ac961c9 commit 0a53ced
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const tabs = [
ROUTES.OTHER_TOOLS,
];

const isProd = ENVIRONMENT === "prod";
const isProd = RUNTIME_ENV === "prod";

const BADGE_COLOR_MAP = {
local: "pink",
Expand Down Expand Up @@ -69,8 +69,8 @@ export default function Header() {
RMG Utils for Stellaris
</Text>
{!isProd && (
<Badge color={BADGE_COLOR_MAP[ENVIRONMENT]} variant="outline">
{ENVIRONMENT}
<Badge color={BADGE_COLOR_MAP[RUNTIME_ENV]} variant="outline">
{RUNTIME_ENV}
</Badge>
)}
</Group>
Expand Down
2 changes: 1 addition & 1 deletion src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="vite/client" />
declare const APP_VERSION: string;
declare const ENVIRONMENT: "local" | "dev" | "stage" | "prod";
declare const RUNTIME_ENV: "local" | "dev" | "stage" | "prod";

interface ImportMetaEnv {
readonly VITE_NETLIFY_FUNCTIONS_LOCAL_SERVER: string;
Expand Down
5 changes: 2 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { VitePWA } from "vite-plugin-pwa";

const env =
process.env.NODE_ENV === "development" ? "local" : process.env.NODE_ENV;
const env = process.env.RUNTIME_ENV ?? "local";

const PWA_TITLE_MAP = {
local: "RMG Utils (local)",
Expand Down Expand Up @@ -58,6 +57,6 @@ export default defineConfig({
],
define: {
APP_VERSION: JSON.stringify(process.env.npm_package_version),
ENVIRONMENT: JSON.stringify(env),
RUNTIME_ENV: JSON.stringify(env),
},
});

0 comments on commit 0a53ced

Please sign in to comment.