fix: NextJS warns that "window" doesn't exist (#21)

It does, as we only target browser, but okay, we will add a guard.
This commit is contained in:
Patric Stout
2023-11-24 21:26:12 +01:00
committed by GitHub
parent 36e2827404
commit 32482c1a18

View File

@@ -8,7 +8,7 @@ export const FitLink = () => {
const link = useEveShipFitLink();
/* Detect if the fit is loaded on https://eveship.fit */
const isEveShipFit = window.location.hostname === "eveship.fit";
const isEveShipFit = typeof window !== "undefined" && window.location.hostname === "eveship.fit";
const linkText = isEveShipFit ? "link to fit" : "open on eveship.fit";
return <div className={styles.fitlink}>