File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -399,9 +399,8 @@ public bool LoadFromFile(string filePath)
399399 _localStorageService . SetValue ( SliceNames . RIG_SLICE , savedState . RigState ) ;
400400 _localStorageService . SetValue ( SliceNames . ATLAS_SETTINGS_SLICE , savedState . AtlasSettingsState ) ;
401401
402- // TODO: Update the store with the loaded state
403- // This will require dispatching actions to update each slice
404- // For now, we've updated local storage and will need to reload the app
402+ // Note: The scene will be reloaded after this method returns to apply the loaded state.
403+ // The store will be re-initialized from the updated local storage on scene reload.
405404
406405 return true ;
407406 }
Original file line number Diff line number Diff line change 66using Unity . AppUI . Redux ;
77using Unity . AppUI . UI ;
88using UnityEngine ;
9+ using UnityEngine . SceneManagement ;
910using Utils . Types ;
1011
1112namespace UI . ViewModels
@@ -176,7 +177,10 @@ private void LoadStateFromFile()
176177 if ( _storeService . LoadFromFile ( filePath ) )
177178 {
178179 Debug . Log ( $ "Scene state loaded successfully from: { filePath } ") ;
179- Debug . Log ( "Please reload the application to see the loaded state" ) ;
180+ Debug . Log ( "Reloading scene to apply loaded state..." ) ;
181+
182+ // Reload the scene to apply the loaded state from local storage
183+ SceneManager . LoadScene ( SceneManager . GetActiveScene ( ) . buildIndex ) ;
180184 }
181185 else
182186 {
You can’t perform that action at this time.
0 commit comments