Stop navigator throwing errors on inital render
parent
8464e74c43
commit
2a118e1a6b
|
@ -2,8 +2,12 @@ import type dayjs from "@calcom/dayjs";
|
|||
|
||||
export const VeritcalLines = ({ days }: { days: dayjs.Dayjs[] }) => {
|
||||
const isRTL = () => {
|
||||
const userLocale = navigator.language;
|
||||
const userLanguage = new Intl.Locale(userLocale).language;
|
||||
let userLanguage = "en"; // Default to 'en' if navigator is not defined
|
||||
|
||||
if (typeof window !== "undefined" && typeof navigator !== "undefined") {
|
||||
const userLocale = navigator.language;
|
||||
userLanguage = new Intl.Locale(userLocale).language;
|
||||
}
|
||||
return ["ar", "he", "fa", "ur"].includes(userLanguage);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue