Update implementation for environment limit paywall

This commit is contained in:
Tuan Dang
2023-06-15 15:48:19 +01:00
parent 391e37d49e
commit ccaf9a9ffc
2 changed files with 20 additions and 3 deletions
@@ -89,8 +89,8 @@ export const ProjectSettingsPage = () => {
// get user subscription
const { subscription } = useSubscription();
const host = window.location.origin;
const isEnvServiceAllowed = (((currentWorkspace?.environments || []).length < (subscription?.environmentLimit || 3)) || host !== 'https://app.infisical.com');
const isEnvServiceAllowed = (subscription?.environmentLimit && currentWorkspace?.environments) ? (currentWorkspace.environments.length < subscription.environmentLimit) : true;
const onRenameWorkspace = async (name: string) => {
try {