fix process.env/import.meta.env usages, TODO linting, fix Emboldened hexadecimal null handling

This commit is contained in:
2024-12-23 18:13:27 -06:00
parent 44ada518b5
commit 841203b0a6
3 changed files with 8 additions and 8 deletions

View File

@@ -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,
}),
],
});

View File

@@ -41,8 +41,8 @@ const Demo = ({ class: className }: DemoProps) => {
session.
<br />
Your session is{" "}
<Emboldened skeletonWidth="0x12345678" copyable={true}>
{"0x" + id?.toString(16).toUpperCase()}
<Emboldened skeletonWidth="0x1234567890ABCDEF" copyable={true}>
{id != null ? "0x" + id?.toString(16).toUpperCase() : null}
</Emboldened>
. You have{" "}
<Emboldened className="text-teal-400 font-inter">

View File

@@ -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"
);