fix self-hosting
This commit is contained in:
@@ -24,7 +24,7 @@ export function getIsCluster() {
|
||||
}
|
||||
|
||||
export function getIsSelfHosting() {
|
||||
return process.env.VITE_SELF_HOSTED === 'true' || !!process.env.SELF_HOSTED;
|
||||
return process.env.SELF_HOSTED === 'true' || !!process.env.SELF_HOSTED;
|
||||
}
|
||||
|
||||
export function getIsDry() {
|
||||
|
||||
@@ -59,7 +59,7 @@ const getPrismaClient = () => {
|
||||
subscriptionStatus: {
|
||||
needs: { subscriptionStatus: true, subscriptionCanceledAt: true },
|
||||
compute(org) {
|
||||
if (process.env.VITE_SELF_HOSTED === 'true') {
|
||||
if (process.env.SELF_HOSTED === 'true') {
|
||||
return 'active';
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ const getPrismaClient = () => {
|
||||
hasSubscription: {
|
||||
needs: { subscriptionStatus: true, subscriptionEndsAt: true },
|
||||
compute(org) {
|
||||
if (process.env.VITE_SELF_HOSTED === 'true') {
|
||||
if (process.env.SELF_HOSTED === 'true') {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ const getPrismaClient = () => {
|
||||
subscriptionPeriodEventsCountExceededAt: true,
|
||||
},
|
||||
compute(org) {
|
||||
if (process.env.VITE_SELF_HOSTED === 'true') {
|
||||
if (process.env.SELF_HOSTED === 'true') {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ const getPrismaClient = () => {
|
||||
isCanceled: {
|
||||
needs: { subscriptionStatus: true, subscriptionCanceledAt: true },
|
||||
compute(org) {
|
||||
if (process.env.VITE_SELF_HOSTED === 'true') {
|
||||
if (process.env.SELF_HOSTED === 'true') {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ const getPrismaClient = () => {
|
||||
subscriptionEndsAt: true,
|
||||
},
|
||||
compute(org) {
|
||||
if (process.env.VITE_SELF_HOSTED === 'true') {
|
||||
if (process.env.SELF_HOSTED === 'true') {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ const getPrismaClient = () => {
|
||||
subscriptionCanceledAt: true,
|
||||
},
|
||||
compute(org) {
|
||||
if (process.env.VITE_SELF_HOSTED === 'true') {
|
||||
if (process.env.SELF_HOSTED === 'true') {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ const getPrismaClient = () => {
|
||||
subscriptionPeriodEventsLimit: true,
|
||||
},
|
||||
compute(org) {
|
||||
if (process.env.VITE_SELF_HOSTED === 'true') {
|
||||
if (process.env.SELF_HOSTED === 'true') {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ const getPrismaClient = () => {
|
||||
subscriptionCurrentPeriodStart: {
|
||||
needs: { subscriptionStartsAt: true, subscriptionInterval: true },
|
||||
compute(org) {
|
||||
if (process.env.VITE_SELF_HOSTED === 'true') {
|
||||
if (process.env.SELF_HOSTED === 'true') {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ const getPrismaClient = () => {
|
||||
subscriptionInterval: true,
|
||||
},
|
||||
compute(org) {
|
||||
if (process.env.VITE_SELF_HOSTED === 'true') {
|
||||
if (process.env.SELF_HOSTED === 'true') {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ async function createOrGetOrganization(
|
||||
},
|
||||
});
|
||||
|
||||
if (process.env.VITE_SELF_HOSTED !== 'true' && !process.env.SELF_HOSTED) {
|
||||
if (!process.env.SELF_HOSTED) {
|
||||
await addTrialEndingSoonJob(
|
||||
organization.id,
|
||||
1000 * 60 * 60 * 24 * TRIAL_DURATION_IN_DAYS * 0.9,
|
||||
|
||||
Reference in New Issue
Block a user