Skip to content

Commit

Permalink
Fix settings loading actions (#5469)
Browse files Browse the repository at this point in the history
Due to a lapse in understanding between `Set all settings` event and
`setAllSettings` action, these were missing from slots where user and
project settings are loaded. We want to fire off these effectful actions
when those settings are updated so that we can, for example, get the
opposite theme for sketch mode properly.
  • Loading branch information
franknoirot authored Feb 24, 2025
1 parent 88c6be8 commit 253a791
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/machines/settingsMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,16 @@ export const settingsMachine = setup({
src: 'loadUserSettings',
onDone: {
target: 'idle',
actions: 'setAllSettings',
actions: [
'setAllSettings',
'setThemeClass',
'setEngineTheme',
'setClientSideSceneUnits',
'setThemeColor',
'setClientTheme',
'setAllowOrbitInSketchMode',
'sendThemeToWatcher',
],
},
onError: {
target: 'idle',
Expand All @@ -561,8 +570,14 @@ export const settingsMachine = setup({
target: 'idle',
actions: [
'setAllSettings',
'setThemeClass',
'setEngineTheme',
'setClientSideSceneUnits',
'setThemeColor',
'Execute AST',
'setClientTheme',
'setAllowOrbitInSketchMode',
'sendThemeToWatcher',
sendTo('registerCommands', { type: 'update' }),
],
},
Expand Down

0 comments on commit 253a791

Please sign in to comment.