Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions src/lib/components/billing/alerts/tooManyFreeOrgs.svelte

This file was deleted.

37 changes: 2 additions & 35 deletions src/lib/stores/billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import { organization, type Organization } from './organization';
import type { InvoiceList, AddressesList, Invoice, PaymentList, PlansMap } from '$lib/sdk/billing';
import { isCloud } from '$lib/system';
import { cachedStore } from '$lib/helpers/cache';
import { Query, type Models } from '@appwrite.io/console';
import { Query } from '@appwrite.io/console';
import { headerAlert } from './headerAlert';
import PaymentAuthRequired from '$lib/components/billing/alerts/paymentAuthRequired.svelte';
import { addNotification, notifications } from './notifications';
import { goto } from '$app/navigation';
import { base } from '$app/paths';
import TooManyFreOrgs from '$lib/components/billing/alerts/tooManyFreeOrgs.svelte';
import { activeHeaderAlert, showPostReleaseModal } from '$routes/console/store';
import { activeHeaderAlert } from '$routes/console/store';
import MarkedForDeletion from '$lib/components/billing/alerts/markedForDeletion.svelte';
import { BillingPlan } from '$lib/constants';

Expand Down Expand Up @@ -266,35 +265,3 @@ export function checkForMarkedForDeletion(org: Organization) {
});
}
}

export async function checkForFreeOrgOverflow(orgs: Models.TeamList<Record<string, unknown>>) {
if (orgs?.teams?.length > 1) {
headerAlert.add({
id: 'freeOrgOverflow',
component: TooManyFreOrgs,
show: true,
importance: 10
});
activeHeaderAlert.set(headerAlert.get());
}
}

export async function checkForPostReleaseProModal(orgs: Models.TeamList<Record<string, unknown>>) {
if (!orgs?.teams?.length) return;
if (orgs.total > orgs.teams.length) return; // if the total is greater that the free orgs it means that there are pro orgs
const modalTime = localStorage.getItem('postReleaseProModal');
const now = Date.now();
// show the modal if it was never shown
if (!modalTime) {
localStorage.setItem('postReleaseProModal', Date.now().toString());
showPostReleaseModal.set(true);
} else {
const interval = 5 * 24 * 60 * 60 * 1000;
const sinceLastModal = now - parseInt(modalTime);
// show the modal if it was shown more than 5 days ago
if (sinceLastModal > interval) {
localStorage.setItem('postReleaseProModal', Date.now().toString());
showPostReleaseModal.set(true);
}
}
}
2 changes: 1 addition & 1 deletion src/lib/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export const MODE = VARS.CONSOLE_MODE === Mode.CLOUD ? Mode.CLOUD : Mode.SELF_HO
export const isCloud = MODE === Mode.CLOUD;
export const isSelfHosted = MODE !== Mode.CLOUD;
export const hasStripePublicKey = !!VARS.STRIPE_PUBLIC_KEY;
export const GRACE_PERIOD_OVERRIDE = true;
export const GRACE_PERIOD_OVERRIDE = false;
Binary file removed src/routes/console/(billing-modal)/hoodie.png
Binary file not shown.
242 changes: 0 additions & 242 deletions src/routes/console/(billing-modal)/hoodieCover.svelte

This file was deleted.

Loading