@@ -8,7 +8,7 @@ import { cachedStore } from '$lib/helpers/cache';
88import { Query , type Models } from '@appwrite.io/console' ;
99import { headerAlert } from './headerAlert' ;
1010import PaymentAuthRequired from '$lib/components/billing/alerts/paymentAuthRequired.svelte' ;
11- import { diffDays , toLocaleDate } from '$lib/helpers/date' ;
11+ import { diffDays } from '$lib/helpers/date' ;
1212import { addNotification , notifications } from './notifications' ;
1313import { goto } from '$app/navigation' ;
1414import { 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-
187169export 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
296278export 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
0 commit comments