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

Fix double trigger of loadColorPalette effect #2118

Merged
merged 3 commits into from
Jan 2, 2025
Merged

Conversation

huchenlei
Copy link
Member

@huchenlei huchenlei commented Jan 1, 2025

  • settingStore.get('Comfy.colorPalette'): Raw setting value. Can be contain invalid id. When changed, trigger loadColorPalette
  • colorPaletteStore.activeColorPaletteId: The valid id of the current active palette, always not null.

┆Issue is synchronized with this Notion page by Unito

@huchenlei huchenlei requested a review from a team as a code owner January 1, 2025 20:19
@huchenlei huchenlei requested a review from a team as a code owner January 1, 2025 22:06
@@ -672,7 +672,11 @@ export const CORE_SETTINGS: SettingParams[] = [
name: 'The active color palette id',
type: 'hidden',
defaultValue: 'dark',
versionModified: '1.6.7'
versionModified: '1.6.7',
migrateDeprecatedValue(value: string) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Previously custom color palettes' id was prefixed with custom_ when persisted to settings.

@@ -180,7 +179,7 @@ export const useColorPaletteService = () => {
return {
addCustomColorPalette: wrapWithErrorHandling(addCustomColorPalette),
deleteCustomColorPalette: wrapWithErrorHandling(deleteCustomColorPalette),
loadColorPalette: wrapWithErrorHandling(loadColorPalette),
loadColorPalette: wrapWithErrorHandlingAsync(loadColorPalette),
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix error handling of async func.

@huchenlei huchenlei added the New Browser Test Expectations New browser test screenshot should be set by github action label Jan 1, 2025
@huchenlei huchenlei merged commit 39e9f42 into main Jan 2, 2025
2 checks passed
@huchenlei huchenlei deleted the fix_double_effect branch January 2, 2025 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Browser Test Expectations New browser test screenshot should be set by github action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant