Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

fix sentry issue: 28c5a41aea3c4435902046e56c435e56

Amruth Pillai2e62eea35167
diff --git a/client/pages/[username]/[slug]/index.tsx b/client/pages/[username]/[slug]/index.tsx
index e4b370a51..e50b52c36 100644
--- a/client/pages/[username]/[slug]/index.tsx
+++ b/client/pages/[username]/[slug]/index.tsx
@@ -61,10 +61,12 @@ const Preview: NextPage<Props> = ({ username, slug, resume: initialData }) => {
}, [dispatch, initialData]);
useEffect(() => {
- if (!isEmpty(resume) && router.locale !== resume.metadata.locale) {
+ const locale = get(resume, 'metadata.locale', 'en');
+
+ if (!isEmpty(resume) && router.locale !== locale) {
const { pathname, asPath, query } = router;
- router.push({ pathname, query }, asPath, { locale: resume.metadata.locale });
+ router.push({ pathname, query }, asPath, { locale });
}
}, [resume, router]);
diff --git a/client/pages/[username]/[slug]/printer.tsx b/client/pages/[username]/[slug]/printer.tsx
index dded2748b..802205624 100644
--- a/client/pages/[username]/[slug]/printer.tsx
+++ b/client/pages/[username]/[slug]/printer.tsx
@@ -35,7 +35,7 @@ export const getServerSideProps: GetServerSideProps<Props | Promise<Props>, Quer
if (isEmpty(secretKey)) throw new Error('There is no secret key!');
const resume = await fetchResumeByIdentifier({ username, slug, options: { secretKey } });
- const displayLocale = resume.metadata.locale || locale || 'en';
+ const displayLocale = get(resume, 'metadata.locale') ?? locale ?? 'en';
return {
props: {