Skip to content

Conversation

@stuartbreckenridge
Copy link
Member

When setting a new theme, these three functions need to run in sequence.

AppDefaults.shared.currentThemeName = newValue
updateThemeNames()
updateCurrentTheme()

Within updateThemeNames() there is a Task { @MainActor in } that allows updateCurrentTheme() to complete before updateThemeNames() returns. In this scenario, when `updateCurrentTheme() is run the app hasn't got an itinerary of installed themes, so it sets the current them back to Default.

Removing the Task fixes the persistence issue.

When setting a new theme, these three functions need to run in sequence.

AppDefaults.shared.currentThemeName = newValue
updateThemeNames()
updateCurrentTheme()

Within updateThemeNames() there is a `Task { @mainactor in }` that allows  `updateCurrentTheme()` to complete before `updateThemeNames()`. In this scenario, when `updateCurrentTheme() is run the app hasnt got an itinerary of installed themes, so it sets the current them back to Default.

Removing the `Task` fixes the persistence issue.
@brentsimmons brentsimmons merged commit 817909b into Ranchero-Software:main Jan 10, 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.

2 participants