Skip to content

Commit

Permalink
frontend: Open main menu only after slider has closed
Browse files Browse the repository at this point in the history
Main menu and disarm slider will not coexist on the screen while opening the menu with the vehicle armed
  • Loading branch information
ArturoManzoli authored and patrickelectric committed Mar 27, 2024
1 parent c78cd8b commit 0736a60
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/App.vue
Expand Up @@ -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
})
}
Expand Down

0 comments on commit 0736a60

Please sign in to comment.