Skip to content

Commit

Permalink
fix(docs): build failure for changing to ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
krisantrobus committed Feb 19, 2025
1 parent 67b66e1 commit b27d1ee
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { SiteSearch } from "../../site-search";
const SiteHeaderSearch: React.FC = () => {
const [isOpen, setIsOpen] = React.useState(false);
const { breakpointIndex } = useWindowSize();
const isMacOS = navigator.platform.toUpperCase().includes("MAC");
// navigator is not available in SSR, so we need to check if it exists before using it
const isMacOS = typeof window !== "undefined" && navigator && navigator?.platform.toUpperCase().includes("MAC");
const platformTriggerKey = isMacOS ? "Meta" : "Control";

const onOpen = (): void => {
Expand Down

0 comments on commit b27d1ee

Please sign in to comment.