From c5e9578105432756c80c9151d559927e929c19f9 Mon Sep 17 00:00:00 2001 From: Arturo Manzoli Date: Wed, 27 Mar 2024 07:16:53 -0300 Subject: [PATCH] frontend: Open main menu only after slider has closed Main menu and disarm slider will not coexist on the screen while opening the menu with the vehicle armed --- src/App.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index 1fa5ba096..851ebf52a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -187,18 +187,22 @@ const openMainMenu = (): void => { requestDisarmConfirmationPopup = true Swal.fire({ title: 'Be careful', - text: 'Vehicle is currently armed, its not recommended to open the main menu.', + text: 'The vehicle is currently armed, it is not recommended to open the main menu.', icon: 'warning', showCancelButton: true, showConfirmButton: true, cancelButtonText: 'Continue anyway', confirmButtonText: 'Disarm vehicle', }).then((result) => { + // Opens the main menu only after disarming by the slider is confirmed if (result.isConfirmed && vehicleStore.isArmed) { - vehicleStore.disarm() + vehicleStore.disarm().then(() => { + showMainMenu.value = true + }) + } else if (result.dismiss === Swal.DismissReason.cancel) { + showMainMenu.value = true } requestDisarmConfirmationPopup = false - showMainMenu.value = true }) }