Merge pull request #71 from artslidd/develop

fix: use useMaybeUser in UpgradeBlockProvider to avoid crash
This commit is contained in:
Arthur Belleville 2026-04-07 21:17:29 +02:00 committed by GitHub
commit 5d01670193
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,7 @@
import React, { createContext, useContext } from "react";
import { getOrganizationUpgradeBlockReason, type UpgradeBlockReason } from "../hooks/stripe";
import { useOrganization } from "../hooks/organization";
import { useUser } from "../providers/UserStoreProvider";
import { useMaybeUser } from "../providers/UserStoreProvider";
interface UpgradeBlockContextValue {
isBlocked: boolean;
@ -26,10 +26,10 @@ interface UpgradeBlockProviderProps {
export const UpgradeBlockProvider: React.FC<UpgradeBlockProviderProps> = ({ children }) => {
const { data: organizationData } = useOrganization();
const user = useUser();
const user = useMaybeUser();
const reason =
user.is_temporary
user?.is_temporary
? null
: organizationData
? getOrganizationUpgradeBlockReason({