Merge pull request #71 from artslidd/develop
fix: use useMaybeUser in UpgradeBlockProvider to avoid crash
This commit is contained in:
commit
5d01670193
1 changed files with 3 additions and 3 deletions
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Reference in a new issue