Skip to content

Commit 692991e

Browse files
Merge branch 'feat-profiles' of https://github.com/appwrite/console into feat-profiles-org-platform
2 parents 5d14bfc + e625eb9 commit 692991e

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/lib/stores/billing.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import BudgetLimitAlert from '$routes/(console)/organization-[organization]/budg
4141
import TeamReadonlyAlert from '$routes/(console)/organization-[organization]/teamReadonlyAlert.svelte';
4242
import ProjectsLimit from '$lib/components/billing/alerts/projectsLimit.svelte';
4343
import EnterpriseTrial from '$routes/(console)/organization-[organization]/enterpriseTrial.svelte';
44+
import { ProfileMode, resolvedProfile } from '$lib/profiles/index.svelte';
4445

4546
export type Tier = 'tier-0' | 'tier-1' | 'tier-2' | 'auto-1' | 'cont-1' | 'ent-1';
4647

@@ -572,6 +573,8 @@ export async function checkForMissingPaymentMethod() {
572573

573574
// Display upgrade banner for new users after 1 week for 30 days
574575
export async function checkForNewDevUpgradePro(org: Organization) {
576+
if (resolvedProfile.id !== ProfileMode.CONSOLE) return;
577+
575578
// browser or plan check.
576579
if (!browser || org?.billingPlan !== BillingPlan.FREE) return;
577580

src/lib/stores/database.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import BackupDatabase from '$lib/components/backupDatabaseAlert.svelte';
77
import { shouldShowNotification } from '$lib/helpers/notifications';
88
import { isCloud } from '$lib/system';
99
import { currentPlan } from '$lib/stores/organization';
10+
import { ProfileMode, resolvedProfile } from '$lib/profiles/index.svelte';
1011

1112
export const database = derived(page, ($page) => $page.data?.database as Models.Database);
1213

@@ -19,7 +20,10 @@ export async function checkForDatabaseBackupPolicies(
1920
projectId: string,
2021
database: Models.Database
2122
) {
22-
// fast path: return if user dismissed the banner
23+
// fast path: not the valid profile to show this!
24+
if (resolvedProfile.id !== ProfileMode.CONSOLE) return;
25+
26+
// fast path: return if user dismissed the banner.
2327
if (!shouldShowNotification(backupsBannerId)) return;
2428

2529
let total = 0;

src/routes/(console)/bottomAlerts.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { isSameDay } from '$lib/helpers/date';
33
import { type BottomModalAlertItem, showBottomModalAlert } from '$lib/stores/bottom-alerts';
44
import DbOperatorsDark from '$lib/images/promos/db-operators-dark.png';
55
import DbOperatorsLight from '$lib/images/promos/db-operators-light.png';
6+
import { ProfileMode, resolvedProfile } from '$lib/profiles/index.svelte';
67

78
const listOfPromotions: BottomModalAlertItem[] = [];
89

@@ -30,6 +31,9 @@ if (isCloud) {
3031
}
3132

3233
export function addBottomModalAlerts() {
34+
// fast path: not the valid profile to show this!
35+
if (resolvedProfile.id !== ProfileMode.CONSOLE) return;
36+
3337
listOfPromotions.forEach((promotion) => showBottomModalAlert(promotion));
3438
}
3539

0 commit comments

Comments
 (0)