Skip to content

Fix loading custom presets for different log types#961

Merged
1Blademaster merged 3 commits into
mainfrom
956-bug-cant-load-custom-saved-preset
Jan 26, 2026
Merged

Fix loading custom presets for different log types#961
1Blademaster merged 3 commits into
mainfrom
956-bug-cant-load-custom-saved-preset

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings January 25, 2026 16:37
@1Blademaster 1Blademaster linked an issue Jan 25, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in loading custom presets for different log types by introducing a centralized mapping function and adding support for MP telemetry logs. Previously, the code was constructing incorrect custom preset category keys (e.g., custom_dataflash_log instead of custom_dataflash) and using simple string comparisons that couldn't handle all log type values correctly.

Changes:

  • Added getPresetKeys() helper function to map log types to their corresponding category and storage keys
  • Added support for mp_telemetry log type with its own custom preset category
  • Refactored preset save/delete/find functions to use the new helper function for consistent key resolution

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
gcs/src/components/fla/presetsAccordion.jsx Updated to use getPresetKeys() helper for resolving custom preset category keys instead of string concatenation
gcs/src/components/fla/presetCategories.js Added getPresetKeys() helper function, MP telemetry support, and refactored localStorage loading to handle all preset types uniformly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gcs/src/components/fla/presetsAccordion.jsx Outdated
Comment thread gcs/src/components/fla/presetCategories.js
Comment thread gcs/src/components/fla/presetCategories.js Outdated
@1Blademaster 1Blademaster merged commit 1488243 into main Jan 26, 2026
5 checks passed
@1Blademaster 1Blademaster deleted the 956-bug-cant-load-custom-saved-preset branch January 26, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Can't load custom saved preset

2 participants