File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -317,15 +317,15 @@ export function calculateTrialDay(org: Organization) {
317
317
return days ;
318
318
}
319
319
320
- export function checkForProjectsLimit ( org : Organization , projects : number ) {
320
+ export async function checkForProjectsLimit ( org : Organization , projects : number ) {
321
321
if ( ! isCloud ) return ;
322
322
if ( ! org || ! projects ) return ;
323
- const plan = get ( plansInfo ) ?. get ( org . billingPlan ) ;
323
+ const plan = await sdk . forConsole . billing . getOrganizationPlan ( org . $id ) ;
324
324
if ( ! plan ) return ;
325
325
if ( plan . $id !== BillingPlan . FREE ) return ;
326
326
if ( org . projects . length > 0 ) return ;
327
327
328
- if ( projects > plan . projects ) {
328
+ if ( plan . projects > 0 && projects > plan . projects ) {
329
329
headerAlert . add ( {
330
330
id : 'projectsLimitReached' ,
331
331
component : ProjectsLimit ,
You can’t perform that action at this time.
0 commit comments