diff --git a/src/routes/console/onboarding/+page.svelte b/src/routes/console/onboarding/+page.svelte index 747972848..7f8cffad3 100644 --- a/src/routes/console/onboarding/+page.svelte +++ b/src/routes/console/onboarding/+page.svelte @@ -15,11 +15,9 @@ let name: string; let id: string; let showCustomId = false; - let loading = false; async function createProject() { try { - loading = true; const org = await createOrganization(); const project = await sdk.forConsole.projects.create( id ?? ID.unique(), @@ -34,7 +32,6 @@ teamId: org.$id }); } catch (error) { - loading = false; addNotification({ message: error.message, type: 'error' @@ -57,7 +54,6 @@ label="Project name" placeholder="First Appwrite Project" required - disabled={loading} bind:value={name} /> {#if !showCustomId}
@@ -70,7 +66,7 @@ {:else} {/if} - diff --git a/src/routes/console/organization-[organization]/createProject.svelte b/src/routes/console/organization-[organization]/createProject.svelte index 04d8aaf7b..1caa4ed6a 100644 --- a/src/routes/console/organization-[organization]/createProject.svelte +++ b/src/routes/console/organization-[organization]/createProject.svelte @@ -18,11 +18,9 @@ let name: string; let showCustomId = false; let error: string; - let isCreating = false; async function create() { try { - isCreating = true; const project = await sdk.forConsole.projects.create( id ?? ID.unique(), name, @@ -40,7 +38,6 @@ }); await goto(`/console/project-${project.$id}`); } catch (e) { - isCreating = false; error = e.message; trackError(e, Submit.ProjectCreate); } @@ -50,13 +47,7 @@ Create Project - + {#if !showCustomId}
(showCustomId = !showCustomId)}> @@ -71,6 +62,6 @@ - + diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte index cc8f7c9f1..c1c21e6d1 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte @@ -31,8 +31,8 @@ value: attribute.key, label: attribute.key })); + let attributeList = [{ value: '', order: '' }]; - let creating = false; function initialize() { attributeList = externalAttribute @@ -47,8 +47,7 @@ initialize(); } - $: addAttributeDisabled = - !attributeList.at(-1)?.value || !attributeList.at(-1)?.order || creating; + $: addAttributeDisabled = !attributeList.at(-1)?.value || !attributeList.at(-1)?.order; async function create() { if (!(key && selectedType && !addAttributeDisabled)) { @@ -56,8 +55,6 @@ return; } - creating = true; - try { await sdk.forProject.databases.createIndex( databaseId, @@ -81,15 +78,13 @@ type: 'success' }); trackEvent(Submit.IndexCreate); + showCreateIndex = false; } catch (error) { addNotification({ message: error.message, type: 'error' }); trackError(error, Submit.IndexCreate); - } finally { - showCreateIndex = false; - creating = false; } } @@ -156,6 +151,6 @@ - +