From 4eb6d1e624edf10dc2c53fc9f1794196ca01732c Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 8 Jul 2021 12:56:35 +0100 Subject: [PATCH] Fix modal flashing when reverting app version and fix version number being incorrect --- .../builder/src/components/deploy/VersionModal.svelte | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/deploy/VersionModal.svelte b/packages/builder/src/components/deploy/VersionModal.svelte index 541f37ad50..0fb061face 100644 --- a/packages/builder/src/components/deploy/VersionModal.svelte +++ b/packages/builder/src/components/deploy/VersionModal.svelte @@ -38,7 +38,9 @@ if (response.status !== 200) { throw json.message } - await refreshAppPackage() + + // Don't wait for the async refresh, since this causes modal flashing + refreshAppPackage() notifications.success( `App updated successfully to version ${clientPackage.version}` ) @@ -49,6 +51,7 @@ const revert = async () => { try { + const revertableVersion = $store.revertableVersion const response = await api.post( `/api/applications/${appId}/client/revert` ) @@ -56,9 +59,11 @@ if (response.status !== 200) { throw json.message } - await refreshAppPackage() + + // Don't wait for the async refresh, since this causes modal flashing + refreshAppPackage() notifications.success( - `App reverted successfully to version ${$store.revertableVersion}` + `App reverted successfully to version ${revertableVersion}` ) } catch (err) { notifications.error(`Error reverting app: ${err}`)