-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: option to enforce language for bookingPage #18782
base: main
Are you sure you want to change the base?
feat: option to enforce language for bookingPage #18782
Conversation
@vijayraghav-io is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (01/21/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (01/21/25)1 label was added to this PR based on Keith Williams's automation. |
try { | ||
const bookerContext = useBookerI18n(); | ||
if (bookerContext.isLocaleReady) { | ||
return bookerContext; | ||
} | ||
} catch {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why catch {} ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a fallback, if useLocale is called from non-booker components , it should use global locale or the atom context locale (as per prev or existing flow).
instead of having this entire snippet inside catch
if (context?.clientId) {
return {
i18n: context.i18n,
t: context.t,
isLocaleReady: true,
} as unknown as {
i18n: ReturnType<typeof useTranslation>["i18n"];
t: ReturnType<typeof useTranslation>["t"];
isLocaleReady: boolean;
};
}
return {
i18n,
t,
isLocaleReady,
};
leaving catch {} looked legit to me, also its not required to log here for non-booker components as it's normal flow.
try {} is used here as useBookerI18n()
throws error for non-booker components
E2E results are ready! |
What does this PR do?
/claim #18710
https://www.loom.com/share/50790635a82f4767a4c1824167daf096?sid=acfe7870-5c4e-4c21-9997-724da66b7fde
Mandatory Tasks (DO NOT REMOVE)