fix(ui): treat missing game folders as unset

Validate the persisted game directory before sending it to the backend or
showing library content for it. When the saved path no longer exists, the
launcher keeps the top bar visible but shows the folder picker empty state
and labels the Game Folder button as an unset folder.

This keeps stale local data from being presented as the active library when
an old path is deleted or disconnected.

Test Plan:
- git diff --check
- just frontend-test
- just build
This commit is contained in:
2026-05-21 19:14:11 +02:00
parent e0efb69bf0
commit 31ace174e3
7 changed files with 94 additions and 47 deletions
@@ -856,6 +856,11 @@ fn ui_operation_from_peer(operation: ActiveOperationKind) -> UiOperationKind {
}
}
#[tauri::command]
fn game_directory_exists(path: String) -> bool {
PathBuf::from(path).is_dir()
}
#[tauri::command]
async fn update_game_directory(app_handle: tauri::AppHandle, path: String) -> tauri::Result<()> {
log::info!("update_game_directory: {path}");
@@ -1803,6 +1808,7 @@ pub fn run() {
install_game,
run_game,
start_server,
game_directory_exists,
update_game_directory,
update_game,
uninstall_game,