diff --git a/crates/lanspread-tauri-deno-ts/src-tauri/src/lib.rs b/crates/lanspread-tauri-deno-ts/src-tauri/src/lib.rs index 3ce3445..a1481ba 100644 --- a/crates/lanspread-tauri-deno-ts/src-tauri/src/lib.rs +++ b/crates/lanspread-tauri-deno-ts/src-tauri/src/lib.rs @@ -2286,12 +2286,6 @@ fn apply_peer_remote_view( } } -fn clear_all_local_game_states(game_db: &mut GameDB) { - for game in game_db.games.values_mut() { - clear_local_game_state(game); - } -} - fn emit_game_transfer_status_snapshot( app_handle: &AppHandle, snapshot: &GameTransferStatusSnapshot, @@ -3112,10 +3106,10 @@ async fn update_game_directory( reset_game_transfer_status_for_root(&app_handle).await?; } *state.games_folder.write().await = accepted_path.clone(); - if accepted_path_changed { - let mut game_db = state.games.write().await; - clear_all_local_game_states(&mut game_db); - } + // Core's accepted root transition publishes the replacement local snapshot; + // the transfer-status fence above has already applied its queued events. + // Keep those local flags when committing the path. ListGames refreshes only + // remote availability and cannot restore a snapshot erased here. emit_games_list(&app_handle).await; if let Some(peer_ctrl) = state.peer_ctrl.read().await.as_ref()