Skip to content

Commit 203bd6d

Browse files
committed
fix: remove trial ending notification
1 parent 720f0ec commit 203bd6d

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

src/lib/stores/billing.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { cachedStore } from '$lib/helpers/cache';
88
import { Query, type Models } from '@appwrite.io/console';
99
import { headerAlert } from './headerAlert';
1010
import PaymentAuthRequired from '$lib/components/billing/alerts/paymentAuthRequired.svelte';
11-
import { diffDays, toLocaleDate } from '$lib/helpers/date';
11+
import { diffDays } from '$lib/helpers/date';
1212
import { addNotification, notifications } from './notifications';
1313
import { goto } from '$app/navigation';
1414
import { base } from '$app/paths';
@@ -166,24 +166,6 @@ export function calculateTrialDay(org: Organization) {
166166
return days;
167167
}
168168

169-
export function checkForTrialEnding(org: Organization) {
170-
const days = calculateTrialDay(org);
171-
if (localStorage.getItem('trialEndingNotification') === 'true' || !days) return;
172-
else if (days <= 5) {
173-
addNotification({
174-
type: 'info',
175-
isHtml: true,
176-
message: `<b>We hope you've been enjoying the ${
177-
tierToPlan(org.billingPlan).name
178-
} plan.</b>
179-
You will be billed on a recurring 30-day cycle after your trial period ends on <b>${toLocaleDate(
180-
org.billingStartDate
181-
)}</b>`
182-
});
183-
localStorage.setItem('trialEndingNotification', 'true');
184-
}
185-
}
186-
187169
export async function checkForUsageLimit(org: Organization) {
188170
if (!org?.billingLimits) {
189171
readOnly.set(false);
@@ -295,6 +277,7 @@ export async function checkForFreeOrgOverflow(orgs: Models.TeamList<Record<strin
295277

296278
export async function checkForPostReleaseProModal(orgs: Models.TeamList<Record<string, unknown>>) {
297279
if (!orgs?.teams?.length) return;
280+
if (orgs.total > orgs.teams.length) return; // if the total is greater that the free orgs it means that there are pro orgs
298281
const modalTime = localStorage.getItem('postReleaseProModal');
299282
const now = Date.now();
300283
// show the modal if it was never shown

src/routes/console/+layout.svelte

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
checkForUsageLimit,
1919
checkPaymentAuthorizationRequired,
2020
calculateTrialDay,
21-
checkForTrialEnding,
2221
paymentExpired,
2322
checkForFreeOrgOverflow,
2423
checkForPostReleaseProModal,
@@ -282,7 +281,6 @@
282281
if (!org) return;
283282
if (isCloud) {
284283
calculateTrialDay(org);
285-
checkForTrialEnding(org);
286284
await paymentExpired(org);
287285
await checkForUsageLimit(org);
288286
checkForMarkedForDeletion(org);

0 commit comments

Comments
 (0)