mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
fix: prevent new projects from overriding global theme setting
When creating new projects, the theme was always explicitly set even when matching the global theme. This caused "Use Global Theme" to be unchecked, preventing global theme changes from affecting the project. Now theme is only set on new projects when explicitly provided or when recovering a trashed project's theme preference.
This commit is contained in:
@@ -24,10 +24,10 @@ export function ThemeStep({ onNext, onBack }: ThemeStepProps) {
|
||||
|
||||
const handleThemeClick = (themeValue: string) => {
|
||||
setTheme(themeValue as typeof theme);
|
||||
// Also update the current project's theme if one exists
|
||||
// This ensures the selected theme is visible since getEffectiveTheme() prioritizes project theme
|
||||
if (currentProject) {
|
||||
setProjectTheme(currentProject.id, themeValue as typeof theme);
|
||||
// Clear the current project's theme so it uses the global theme
|
||||
// This ensures "Use Global Theme" is checked and the project inherits the global theme
|
||||
if (currentProject && currentProject.theme !== undefined) {
|
||||
setProjectTheme(currentProject.id, null);
|
||||
}
|
||||
setPreviewTheme(null);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user