🚑 fix vercel yarn run build fail (#919)

This commit is contained in:
Zineb El Bachiri 2023-08-10 13:07:22 +02:00 committed by GitHub
parent ef429b8ef4
commit f3d9c89163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@ import { useEventTracking } from "@/services/analytics/useEventTracking";
export const useInvitation = () => {
const { t } = useTranslation(["brain", "invitation"]);
const params = useParams();
const brainId = params.brainId as UUID | undefined;
const brainId = params?.brainId as UUID | undefined;
const [isLoading, setIsLoading] = useState(false);
const [brainName, setBrainName] = useState<string>("");
const [role, setRole] = useState<BrainRoleType | undefined>();
@ -51,7 +51,7 @@ export const useInvitation = () => {
} else {
publish({
variant: "danger",
text: t("errorCheckingInvitation",{ns:"invitation"})
text: t("errorCheckingInvitation", { ns: "invitation" }),
});
}
router.push("/");
@ -88,7 +88,7 @@ export const useInvitation = () => {
console.error("Error calling the API:", error);
publish({
variant: "danger",
text: t("errorAccepting",{ns:"invitation"})
text: t("errorAccepting", { ns: "invitation" }),
});
}
} finally {
@ -103,7 +103,7 @@ export const useInvitation = () => {
await declineInvitation(brainId);
publish({
variant: "success",
text: t("declined",{ns:"invitation"})
text: t("declined", { ns: "invitation" }),
});
void track("INVITATION_DECLINED");
} catch (error) {
@ -119,7 +119,7 @@ export const useInvitation = () => {
} else {
publish({
variant: "danger",
text: t("errorDeclining",{ns:"invitation"})
text: t("errorDeclining", { ns: "invitation" }),
});
}
} finally {