Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disarming the vehicle using the warning modal when opening menu with armed vehicle is generating dead state #833 #839

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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