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

Alert when Cockpit is minimized while vehicle is still armed #1379

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ArturoManzoli
Copy link
Contributor

Two alerts will be fired, voice (warning level) and electron desktop notification.

Closes #1377

@ArturoManzoli ArturoManzoli marked this pull request as draft October 2, 2024 20:18
Comment on lines +170 to +179
alertStore.pushAlert(
new Alert(
AlertLevel.Warning,
'Warning: Vehicle armed and Cockpit minimized. Joystick inputs are stopped. Ensure vehicle safety.'
)
)
showElectronDesktopNotification(
'Vehicle armed and Cockpit minimized. Joystick inputs are stopped. Ensure vehicle safety.'
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case the alert will be disabled if the user disabled the general voice alerts or warning alerts.
We should create add a "force" parameter to the pushAlert method and have a dedicated switch to disable this voice alert.

Comment on lines +173 to +178
'Warning: Vehicle armed and Cockpit minimized. Joystick inputs are stopped. Ensure vehicle safety.'
)
)
showElectronDesktopNotification(
'Vehicle armed and Cockpit minimized. Joystick inputs are stopped. Ensure vehicle safety.'
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Messages are being replicated here. You can assign them to a variable and reuse. Will also consume less lines.

Also, could we make the message more explicit? Like "Cockpit minimized while vehicle is armed. Joystick inputs will not work. Ensure vehicle safety."?

@rafaellehmkuhl
Copy link
Member

You can use this to check if the application is running on Electron. Will work on both the Node process as well as the renderer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users should be warned (with voice and/or notifications) when Cockpit is minimized while the vehicle is armed
2 participants