@@ -8,7 +8,7 @@ import { cachedStore } from '$lib/helpers/cache';
8
8
import { Query , type Models } from '@appwrite.io/console' ;
9
9
import { headerAlert } from './headerAlert' ;
10
10
import PaymentAuthRequired from '$lib/components/billing/alerts/paymentAuthRequired.svelte' ;
11
- import { diffDays , toLocaleDate } from '$lib/helpers/date' ;
11
+ import { diffDays } from '$lib/helpers/date' ;
12
12
import { addNotification , notifications } from './notifications' ;
13
13
import { goto } from '$app/navigation' ;
14
14
import { base } from '$app/paths' ;
@@ -166,24 +166,6 @@ export function calculateTrialDay(org: Organization) {
166
166
return days ;
167
167
}
168
168
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
-
187
169
export async function checkForUsageLimit ( org : Organization ) {
188
170
if ( ! org ?. billingLimits ) {
189
171
readOnly . set ( false ) ;
@@ -295,6 +277,7 @@ export async function checkForFreeOrgOverflow(orgs: Models.TeamList<Record<strin
295
277
296
278
export async function checkForPostReleaseProModal ( orgs : Models . TeamList < Record < string , unknown > > ) {
297
279
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
298
281
const modalTime = localStorage . getItem ( 'postReleaseProModal' ) ;
299
282
const now = Date . now ( ) ;
300
283
// show the modal if it was never shown
0 commit comments