diff --git a/frontend/astro.config.mjs b/frontend/astro.config.mjs index d3f0511..e506ebe 100644 --- a/frontend/astro.config.mjs +++ b/frontend/astro.config.mjs @@ -4,14 +4,16 @@ import tailwind from "@astrojs/tailwind"; import sitemap from "@astrojs/sitemap"; import preact from "@astrojs/preact"; +// TODO: Add linting to build steps + // https://astro.build/config export default defineConfig({ build: { assets: "assets", }, - site: process.env.DEV + site: import.meta.env.DEV ? "https://localhost:4321" - : `https://${process.env.RAILWAY_PUBLIC_DOMAIN}`, + : `https://${import.meta.env.RAILWAY_PUBLIC_DOMAIN}`, integrations: [ tailwind(), sitemap({ @@ -20,7 +22,7 @@ export default defineConfig({ // xslURL: "/sitemap.xsl", }), preact({ - devtools: process.env.DEV != undefined ? true : false, + devtools: import.meta.DEV ?? false, }), ], }); diff --git a/frontend/src/components/Demo.tsx b/frontend/src/components/Demo.tsx index babb2b5..2334ca4 100644 --- a/frontend/src/components/Demo.tsx +++ b/frontend/src/components/Demo.tsx @@ -41,8 +41,8 @@ const Demo = ({ class: className }: DemoProps) => { session.
Your session is{" "} - - {"0x" + id?.toString(16).toUpperCase()} + + {id != null ? "0x" + id?.toString(16).toUpperCase() : null} . You have{" "} diff --git a/frontend/src/components/useSocket.ts b/frontend/src/components/useSocket.ts index bcc2a92..1f4f54c 100644 --- a/frontend/src/components/useSocket.ts +++ b/frontend/src/components/useSocket.ts @@ -30,9 +30,7 @@ function useSocket(): UseSocketResult { useEffect(() => { const socket = new WebSocket( (window.location.protocol === "https:" ? "wss://" : "ws://") + - (import.meta.env.DEV != undefined - ? "localhost:5800" - : window.location.host) + + (import.meta.env.DEV ? "localhost:5800" : window.location.host) + "/ws" );