- {#if !hasPlatforms}
+ {#if platforms.length === 0 || pingCount === 0}
@@ -46,7 +84,7 @@
Add a platform
+ size="s">Connect your platform
Start building with your preferred web, mobile, and
@@ -59,95 +97,254 @@
- addPlatform(0)} padding="s"
- > {
+ openPlatformWizard(0, platformMap.get('Web'));
+ }}
+ padding="s"
+ >
+ {#if platformMap.has('Web')}
+
+
+
+
+
+ {/if}
Web
-
-
-
+ {#if platformMap.has('Web')}Continue{:else}
+
+
+
+ {/if}
-
-
+ {
+ openPlatformWizard(4, platformMap.get('React Native'));
+ }}
+ padding="s"
+ >
+
+
+
+
+ {#if platformMap.has('React Native')}
+
+
+
+
+
+ {/if}
- Server
-
-
-
+ React Native
+ {#if platformMap.has('React Native')}Continue{:else}
+
+
+
+ {/if}
- addPlatform(3)} padding="s">
-
+ {
+ openPlatformWizard(3, platformMap.get('Apple'));
+ }}
+ padding="s">
+
+ {#if platformMap.has('Apple')}
+
+
+
+
+
+ {/if}
Apple
-
-
-
+ {#if platformMap.has('Apple')}Continue{:else}
+
+
+
+ {/if}
- addPlatform(2)} padding="s">
-
+ {
+ openPlatformWizard(2, platformMap.get('Android'));
+ }}
+ padding="s">
+
+ {#if platformMap.has('Android')}
+
+
+
+
+
+ {/if}
Android
-
-
-
+ {#if platformMap.has('Android')}Continue{:else}
+
+
+
+ {/if}
- addPlatform(1)} padding="s">
-
+ {
+ openPlatformWizard(1, platformMap.get('Flutter'));
+ }}
+ padding="s">
+
+ {#if platformMap.has('Flutter')}
+
+
+
+
+
+ {/if}
Flutter
-
-
-
+ {#if platformMap.has('Flutter')}Continue{:else}
+
+
+
+ {/if}
+
+ Or connect
+ server side
+
+
Add a platform
+ >Connect your platform
{
const unsubscribe = sdk.forConsole.client.subscribe('console', (response) => {
- if (response.events.includes(`projects.${projectId}.ping`) && isPlatformCreated) {
+ if (response.events.includes(`projects.${projectId}.ping`)) {
connectionSuccessful = true;
+ invalidate(Dependencies.ORGANIZATION);
+ invalidate(Dependencies.PROJECT);
unsubscribe();
}
});
@@ -234,7 +235,7 @@ const val APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.endpoint}"
fullWidthMobile
secondary
disabled={isCreatingPlatform}
- href={`${base}/project-${projectId}/overview`}>
+ href={location.pathname}>
Go to dashboard
{/if}
diff --git a/src/routes/(console)/project-[project]/overview/platforms/createApple.svelte b/src/routes/(console)/project-[project]/overview/platforms/createApple.svelte
index cb3db0bd0..3987e15f1 100644
--- a/src/routes/(console)/project-[project]/overview/platforms/createApple.svelte
+++ b/src/routes/(console)/project-[project]/overview/platforms/createApple.svelte
@@ -14,7 +14,6 @@
import { Button, Form, InputText } from '$lib/elements/forms';
import { IconApple, IconAppwrite } from '@appwrite.io/pink-icons-svelte';
import { Card } from '$lib/components';
- import { base } from '$app/paths';
import { page } from '$app/stores';
import { onMount } from 'svelte';
import { sdk } from '$lib/stores/sdk';
@@ -43,7 +42,7 @@
APPWRITE_PUBLIC_ENDPOINT: "${sdk.forProject.client.config.endpoint}"
`;
- let platform: PlatformType = PlatformType.Appleios;
+ export let platform: PlatformType = PlatformType.Appleios;
let platforms: { [key: string]: PlatformType } = {
iOS: PlatformType.Appleios,
@@ -89,8 +88,10 @@ APPWRITE_PUBLIC_ENDPOINT: "${sdk.forProject.client.config.endpoint}"
onMount(() => {
const unsubscribe = sdk.forConsole.client.subscribe('console', (response) => {
- if (response.events.includes(`projects.${projectId}.ping`) && isPlatformCreated) {
+ if (response.events.includes(`projects.${projectId}.ping`)) {
connectionSuccessful = true;
+ invalidate(Dependencies.ORGANIZATION);
+ invalidate(Dependencies.PROJECT);
unsubscribe();
}
});
@@ -129,7 +130,7 @@ APPWRITE_PUBLIC_ENDPOINT: "${sdk.forProject.client.config.endpoint}"
@@ -259,7 +260,7 @@ APPWRITE_PUBLIC_ENDPOINT: "${sdk.forProject.client.config.endpoint}"
fullWidthMobile
secondary
disabled={isCreatingPlatform}
- href={`${base}/project-${projectId}/overview`}>
+ href={location.pathname}>
Go to dashboard
{/if}
diff --git a/src/routes/(console)/project-[project]/overview/platforms/createFlutter.svelte b/src/routes/(console)/project-[project]/overview/platforms/createFlutter.svelte
index afb9a9893..b693aa4ec 100644
--- a/src/routes/(console)/project-[project]/overview/platforms/createFlutter.svelte
+++ b/src/routes/(console)/project-[project]/overview/platforms/createFlutter.svelte
@@ -14,7 +14,6 @@
import { Button, Form, InputText } from '$lib/elements/forms';
import { IconFlutter, IconAppwrite } from '@appwrite.io/pink-icons-svelte';
import { Card } from '$lib/components';
- import { base } from '$app/paths';
import { page } from '$app/stores';
import { onMount } from 'svelte';
import { sdk } from '$lib/stores/sdk';
@@ -42,7 +41,7 @@
static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.endpoint}"
`;
- let platform: PlatformType = PlatformType.Flutterandroid;
+ export let platform: PlatformType = PlatformType.Flutterandroid;
let platforms: { [key: string]: PlatformType } = {
Android: PlatformType.Flutterandroid,
@@ -124,6 +123,7 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.e
trackEvent(Submit.PlatformCreate, {
type: platform
});
+
await Promise.all([
invalidate(Dependencies.PROJECT),
invalidate(Dependencies.PLATFORMS)
@@ -145,8 +145,10 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.e
onMount(() => {
const unsubscribe = sdk.forConsole.client.subscribe('console', (response) => {
- if (response.events.includes(`projects.${projectId}.ping`) && isPlatformCreated) {
+ if (response.events.includes(`projects.${projectId}.ping`)) {
connectionSuccessful = true;
+ invalidate(Dependencies.ORGANIZATION);
+ invalidate(Dependencies.PROJECT);
unsubscribe();
}
});
@@ -316,7 +318,7 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.e
fullWidthMobile
secondary
disabled={isCreatingPlatform}
- href={`${base}/project-${projectId}/overview`}>
+ href={location.pathname}>
Go to dashboard
{/if}
diff --git a/src/routes/(console)/project-[project]/overview/platforms/createReactNative.svelte b/src/routes/(console)/project-[project]/overview/platforms/createReactNative.svelte
index a7fee3fa1..df67f95bf 100644
--- a/src/routes/(console)/project-[project]/overview/platforms/createReactNative.svelte
+++ b/src/routes/(console)/project-[project]/overview/platforms/createReactNative.svelte
@@ -14,7 +14,6 @@
import { Button, Form, InputText } from '$lib/elements/forms';
import { IconReact, IconAppwrite } from '@appwrite.io/pink-icons-svelte';
import { Card } from '$lib/components';
- import { base } from '$app/paths';
import { page } from '$app/stores';
import { onMount } from 'svelte';
import { sdk } from '$lib/stores/sdk';
@@ -28,7 +27,7 @@
import { LabelCard } from '$lib/components';
let showExitModal = false;
- let isPlatformCreated = false;
+ export let isPlatformCreated = false;
let isCreatingPlatform = false;
let connectionSuccessful = false;
const projectId = $page.params.project;
@@ -42,7 +41,7 @@
const APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.endpoint}";
`;
- let platform: PlatformType = PlatformType.Reactnativeandroid;
+ export let platform: PlatformType = PlatformType.Reactnativeandroid;
let platforms: { [key: string]: PlatformType } = {
Android: PlatformType.Reactnativeandroid,
@@ -78,7 +77,7 @@ const APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.endpoint}";
[PlatformType.Reactnativeios]: 'Bundle ID'
};
- async function createFlutterPlatform() {
+ async function createReactNativePlatform() {
try {
isCreatingPlatform = true;
await sdk.forConsole.projects.createPlatform(
@@ -94,7 +93,6 @@ const APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.endpoint}";
trackEvent(Submit.PlatformCreate, {
type: platform
});
-
await Promise.all([
invalidate(Dependencies.PROJECT),
invalidate(Dependencies.PLATFORMS)
@@ -116,8 +114,10 @@ const APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.endpoint}";
onMount(() => {
const unsubscribe = sdk.forConsole.client.subscribe('console', (response) => {
- if (response.events.includes(`projects.${projectId}.ping`) && isPlatformCreated) {
+ if (response.events.includes(`projects.${projectId}.ping`)) {
connectionSuccessful = true;
+ invalidate(Dependencies.ORGANIZATION);
+ invalidate(Dependencies.PROJECT);
unsubscribe();
}
});
@@ -130,7 +130,7 @@ const APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.endpoint}";
-