From c19919ab19d70688477c8aec9131b1a048b0e6db Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 12 Dec 2023 22:27:26 +0100 Subject: [PATCH] feat: open modal on search param set --- .../(billing-modal)/preReleaseModal.svelte | 91 ------------------- src/routes/console/+page.ts | 7 +- src/routes/console/onboarding/+page.svelte | 15 +++ .../organization-[organization]/+page.svelte | 11 ++- 4 files changed, 29 insertions(+), 95 deletions(-) delete mode 100644 src/routes/console/(billing-modal)/preReleaseModal.svelte diff --git a/src/routes/console/(billing-modal)/preReleaseModal.svelte b/src/routes/console/(billing-modal)/preReleaseModal.svelte deleted file mode 100644 index 2551228ec..000000000 --- a/src/routes/console/(billing-modal)/preReleaseModal.svelte +++ /dev/null @@ -1,91 +0,0 @@ - - - - - {#if $app.themeInUse === 'dark'} - - {:else} - - {/if} - - -
-

- Appwrite will enable billing before the end of the year, which means access to our long - awaited Pro plan. It also means you will be limited to one free organization per account. -

-

- Consider upgrading and take advantage of the extra resources that come with the Pro - plan. You can also use Migrations to self-host some of your projects instead. Learn more - in our - trackEvent('click_open_website', { - source: 'pre_billing_release_modal', - destination: 'docs_migration' - })}>documentation. -

-
- - Pro - $15 per member per billing period - -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
- -
-
diff --git a/src/routes/console/+page.ts b/src/routes/console/+page.ts index 14e5b45e9..94665aae5 100644 --- a/src/routes/console/+page.ts +++ b/src/routes/console/+page.ts @@ -2,12 +2,13 @@ import { base } from '$app/paths'; import { redirect } from '@sveltejs/kit'; import type { PageLoad } from './$types'; -export const load: PageLoad = async ({ parent }) => { +export const load: PageLoad = async ({ parent, url }) => { const { organizations, account } = await parent(); + if (organizations.total) { const teamId = account.prefs.organization ?? organizations.teams[0].$id; - throw redirect(303, `${base}/console/organization-${teamId}`); + throw redirect(303, `${base}/console/organization-${teamId}${url.search ?? ''}`); } else { - throw redirect(303, `${base}/console/onboarding`); + throw redirect(303, `${base}/console/onboarding${url.search ?? ''}`); } }; diff --git a/src/routes/console/onboarding/+page.svelte b/src/routes/console/onboarding/+page.svelte index 324474e39..244d86136 100644 --- a/src/routes/console/onboarding/+page.svelte +++ b/src/routes/console/onboarding/+page.svelte @@ -1,5 +1,6 @@