fix(AFC): use correct fallback for empty spool color in filament dialog#2381
Merged
meteyou merged 1 commit intomainsail-crew:developfrom Jan 7, 2026
Merged
Conversation
Signed-off-by: Stefan Dej <meteyou@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the AFC spool details dialog where an empty string color value from AFC would incorrectly default to red (#FF0000) instead of black (#000000). The fix replaces the nullish coalescing operator (??) with the logical OR operator (||) to properly treat empty strings as falsy values.
Key Changes:
- Updated the
currentColorgetter to use||instead of??for proper empty string handling
mryel00
approved these changes
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a bug in the AFC spool details dialog where the color picker would default to red (
#FF0000) instead of black (#000000) when opening the dialog for a spool without a specific color set.The issue was caused by using the nullish coalescing operator (
??) which only checks fornull/undefined, but AFC can return an empty string ('') for the color property. The logical OR operator (||) correctly treats empty strings as falsy and applies the fallback value.Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings
n/a
[optional] Are there any post-deployment tasks we need to perform?
n/a