diff --git a/src/lib/profiles/index.svelte.ts b/src/lib/profiles/index.svelte.ts index 197edb2490..ff62f43b23 100644 --- a/src/lib/profiles/index.svelte.ts +++ b/src/lib/profiles/index.svelte.ts @@ -4,8 +4,6 @@ import { OAuthProvider, Platform } from '@appwrite.io/console'; import { env } from '$env/dynamic/public'; import { BillingPlan } from '@appwrite.io/console'; import type { Component } from 'svelte'; -import UnauthenticatedConsole from './(unauthenticated)/console.svelte'; -import UnauthenticatedStudio from './(unauthenticated)/studio.svelte'; import StudioCss from './css/studio.css?url'; import ConsoleCss from './css/console.css?url'; import { isCloud } from '$lib/system'; @@ -61,7 +59,7 @@ export type Profile = { minimalOrgHeader: boolean; getProjectRoute: (params: { region: string; project: string }) => ResolvedPathname; component: { - unauthenticated: Component; + getUnauthenticated: () => Promise; }; links: { docs: string; @@ -98,9 +96,6 @@ export const base: Profile = { }, alt: 'Logo Appwrite' }, - component: { - unauthenticated: UnauthenticatedConsole - }, logins: [Logins.EMAIL, isCloud && Logins.GITHUB].filter(Boolean), oauthProviders: { github: { @@ -136,6 +131,9 @@ export const base: Profile = { project }); }, + component: { + getUnauthenticated: async () => (await import('./(unauthenticated)/console.svelte')).default + }, links: { website: 'https://appwrite.io', docs: 'https://appwrite.io/docs', @@ -205,9 +203,6 @@ export const studio: Profile = { } }, css: StudioCss, - component: { - unauthenticated: UnauthenticatedStudio - }, showOnboarding: false, useCommandCenter: false, showGithubIssueSupport: false, @@ -235,6 +230,9 @@ export const studio: Profile = { project }); }, + component: { + getUnauthenticated: async () => (await import('./(unauthenticated)/studio.svelte')).default + }, links: { website: 'https://imagine.dev', docs: 'https://imagine.dev', diff --git a/src/lib/stores/sdk.ts b/src/lib/stores/sdk.ts index e985f67eb9..bc07aa98a4 100644 --- a/src/lib/stores/sdk.ts +++ b/src/lib/stores/sdk.ts @@ -114,7 +114,6 @@ if (!building) { scopedConsoleClient.setProject('console'); clientConsole.setEndpoint(endpoint).setProject('console'); - // set platform type! clientConsole.setPlatform(resolvedProfile.platform); scopedConsoleClient.setPlatform(resolvedProfile.platform); diff --git a/src/routes/(authenticated)/mfa/+page.svelte b/src/routes/(authenticated)/mfa/+page.svelte index c078fea780..55bbb0191d 100644 --- a/src/routes/(authenticated)/mfa/+page.svelte +++ b/src/routes/(authenticated)/mfa/+page.svelte @@ -12,7 +12,6 @@ import { resolvedProfile } from '$lib/profiles/index.svelte'; export let data; - const Unauthenticated = resolvedProfile.component.unauthenticated; const factors = data.factors as Models.MfaFactors & { recoveryCode: boolean }; let disabled = false; @@ -53,24 +52,26 @@ Verify - {resolvedProfile.platform} - - -
-
- +{#await resolvedProfile.component.getUnauthenticated() then Unauthenticated} + + +
+
+ +
-
- - Verify your identity -
- - - -
- + + Verify your identity +
+ + + +
+ +{/await}