diff --git a/public/theme.js b/public/theme.js index 07deabd..bed02ba 100644 --- a/public/theme.js +++ b/public/theme.js @@ -2,9 +2,9 @@ // This will cause a rehydration issue but it is what it is console.log("theme"); if ( - JSON.parse(localStorage.getItem("theme") || '""') === "dark" || + JSON.parse(localStorage.getItem("theme") ?? '""') === "dark" || ((!localStorage.getItem("theme") || - JSON.parse(localStorage.getItem("theme") || '""') === "system") && + JSON.parse(localStorage.getItem("theme") ?? '""') === "system") && window.matchMedia("(prefers-color-scheme: dark)").matches) ) { document.documentElement.classList.add("dark"); diff --git a/src/components/dropdown/dropdown.tsx b/src/components/dropdown/dropdown.tsx index 47d2a10..fe23f1a 100644 --- a/src/components/dropdown/dropdown.tsx +++ b/src/components/dropdown/dropdown.tsx @@ -13,7 +13,7 @@ export function Dropdown({ className?: string; }) { const { top, bottom, right, left } = - referenceElement.current?.getBoundingClientRect() || { + referenceElement.current?.getBoundingClientRect() ?? { top: 0, bottom: 0, right: 0,