diff --git a/src/containers/internal/views/accounts/form.tsx b/src/containers/internal/views/accounts/form.tsx index 01bcb313..21c202a5 100644 --- a/src/containers/internal/views/accounts/form.tsx +++ b/src/containers/internal/views/accounts/form.tsx @@ -40,6 +40,7 @@ import { PlanType, USER_ACCOUNT, WEBHOOK_METHODS, + STRIPE_PUBLISHABLE_KEY, } from "src/api/constants"; import { MSG_REQUIRED_FIELDS, MSG_WEBHOOK_FIELDS } from "src/constants"; @@ -85,7 +86,10 @@ export const AccountForm = ({ const user = useSelectState("user"); const currentServiceProvider = useSelectState("currentServiceProvider"); const [accounts] = useApiData("Accounts"); - const [invoice] = useApiData("Invoices"); + // Dont get Invoices if the environment is self-hosted + const [invoice] = STRIPE_PUBLISHABLE_KEY + ? useApiData("Invoices") + : [undefined]; const [userData] = useApiData("Users/me"); const [userCarriers] = useApiData(`VoipCarriers`); const [userSpeechs] = useApiData(