From eb388c51c6ee2b227383af6d62574ce502e8cda2 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 18 Jun 2021 12:23:50 +0100 Subject: [PATCH] Fix screen deletion not waiting for async operations to finish --- .../ComponentNavigationTree/ScreenDropdownMenu.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/ScreenDropdownMenu.svelte b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/ScreenDropdownMenu.svelte index 69491f2c57..c476049a99 100644 --- a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/ScreenDropdownMenu.svelte +++ b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/ScreenDropdownMenu.svelte @@ -10,14 +10,15 @@ $: screen = $allScreens.find(screen => screen._id === screenId) - const deleteScreen = () => { + const deleteScreen = async () => { try { - store.actions.screens.delete(screen) - store.actions.routing.fetch() + await store.actions.screens.delete(screen) + await store.actions.routing.fetch() confirmDeleteDialog.hide() $goto("../") notifications.success("Deleted screen successfully.") } catch (err) { + console.log(err) notifications.error("Error deleting screen") } }