Files
cc-switch/src-tauri
Jason fe190081eb fix: resolve critical bugs in settings and import flow
Fixed two critical issues:

1. **Blocking Issue - restart_app return type error**
   - Fixed compilation error where restart_app() didn't return a value
   - Used async spawn with 100ms delay to allow response before restart
   - Prevents "unreachable code" compiler error

2. **High Priority - Import SQL doesn't refresh AppSettings cache**
   - Added reload_settings() function to refresh in-memory settings cache
   - Integrated into import flow to ensure imported settings take effect
   - Prevents imported settings being overwritten by stale memory cache
   - Affects: language, config directories, auto-launch, custom endpoints

Changes:
- src/commands/settings.rs: Async delayed restart with proper return value
- src/settings.rs: New reload_settings() to sync memory cache from DB
- src/commands/import_export.rs: Call reload_settings() after SQL import

Verified: cargo clippy --lib and pnpm typecheck both pass
2025-11-24 11:25:41 +08:00
..
2025-11-22 19:18:35 +08:00
2025-11-24 11:00:45 +08:00
2025-11-24 11:00:45 +08:00
2025-11-22 19:18:35 +08:00