Skip to content

fix(AFC): use correct fallback for empty spool color in filament dialog#2381

Merged
meteyou merged 1 commit intomainsail-crew:developfrom
meteyou:fix/afc-change-filament-color
Jan 7, 2026
Merged

fix(AFC): use correct fallback for empty spool color in filament dialog#2381
meteyou merged 1 commit intomainsail-crew:developfrom
meteyou:fix/afc-change-filament-color

Conversation

@meteyou
Copy link
Member

@meteyou meteyou commented Jan 6, 2026

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 for null/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

Copy link
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 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 currentColor getter to use || instead of ?? for proper empty string handling

@meteyou meteyou merged commit a446794 into mainsail-crew:develop Jan 7, 2026
12 checks passed
@meteyou meteyou deleted the fix/afc-change-filament-color branch January 7, 2026 09:56
@meteyou meteyou added this to the v2.17.0 milestone Jan 7, 2026
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.

Feature request: keep color same when bringing up spool details panel for AFC

3 participants