-
-
Notifications
You must be signed in to change notification settings - Fork 952
Fix GNSS status icon when fix is attained without sat info #4461
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
Conversation
WalkthroughThe code responsible for updating the GPS sensor status in the UI was refactored. The new implementation introduces boolean variables to represent GPS sensor detection and GPS fix presence, and uses these to streamline the logic for toggling CSS classes on the GPS icon. The condition for displaying the "on" state of the GPS icon was updated to activate if either the sensor is detected or a GPS fix is present. The process for removing CSS classes when GPS is not detected or no fix is present was also consolidated. No changes were made to exported or public entity declarations. Changes
Sequence Diagram(s)sequenceDiagram
participant SensorData
participant SensorHelpers
participant GPSIconUI
SensorData->>SensorHelpers: Update GPS sensor status (detected, fix)
SensorHelpers->>GPSIconUI: Toggle "active", "active_fix", "on" classes based on detection/fix booleans
Assessment against linked issues
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🔇 Additional comments (4)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
Preview URL: https://1e4b8c44.betaflight-configurator.pages.dev |
Some GNSS modules won't send sat info, but could attain a fix.
This pull request refactors the
sensor_status
function insrc/js/sensor_helpers.js
to improve readability and reduce redundant code. The most important change consolidates the logic for toggling GPS icon classes based on sensor detection and GPS fix state.Code refactoring for readability and maintainability:
gnssSensorDetected
andhasGnssFix
constants to clarify the conditions for GPS sensor detection and fix state.active
andactive_fix
) by using thetoggleClass
method, reducing redundancy in class manipulation.active
andactive_fix
) into a singleremoveClass
call for better readability.Summary by CodeRabbit