From 7049f663a2e12b8ef9ca64c303635a4acca6c210 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Mon, 29 Apr 2024 14:38:45 -0700 Subject: [PATCH] fix(migrations): fix modal not closing We should be using a bound show variable to control the modal. Prior to this PR, we were indirectly controlling the modal by setting the migration ID via the on close handler, but that event is never triggered when the modal is closed. This also refactors the modal to pass in the migration instead of a list of migrations and a migration ID because the entire list is not needed inside the modal. --- .../settings/migrations/+page.svelte | 13 +++++++++--- .../settings/migrations/details.svelte | 20 ++++++++----------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/routes/console/project-[project]/settings/migrations/+page.svelte b/src/routes/console/project-[project]/settings/migrations/+page.svelte index 2a7877a02..8d5657b18 100644 --- a/src/routes/console/project-[project]/settings/migrations/+page.svelte +++ b/src/routes/console/project-[project]/settings/migrations/+page.svelte @@ -24,10 +24,12 @@ import Status from '$lib/components/status.svelte'; import { capitalize } from '$lib/helpers/string'; import { readOnly } from '$lib/stores/billing'; + import type { Models } from '@appwrite.io/console'; export let data; - let details: string | null = null; + let migration: Models.Migration = null; let showExport = false; + let showMigration = false; const getStatus = (status: string) => { if (status === 'failed') { @@ -129,6 +131,11 @@ // JSON.stringify(migrationData) // )}`; }; + + function showDetails(m: Models.Migration) { + showMigration = true; + migration = m; + } @@ -182,7 +189,7 @@
-
@@ -296,7 +303,7 @@ -
+