fix(butler): runtime fixes — SQLite mode=rwc + React hooks ordering
Some checks failed
CI / Build Frontend (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

- Add ?mode=rwc to pain.db SQLite URL so it creates the file on first run
- Move useUIModeStore hook before conditional returns in App.tsx to fix
  React "Rendered more hooks than during the previous render" error
This commit is contained in:
iven
2026-04-09 12:15:34 +08:00
parent 646d8c21af
commit 26f50cd746
2 changed files with 23 additions and 9 deletions

View File

@@ -165,7 +165,7 @@ pub fn run() {
std::fs::create_dir_all(&pain_db_dir).expect("Failed to create intelligence dir");
let db_path = pain_db_dir.join("pain.db");
let db_url = format!("sqlite:{}", db_path.display());
let db_url = format!("sqlite:{}?mode=rwc", db_path.display());
let pool = rt.block_on(sqlx::SqlitePool::connect(&db_url))
.expect("Failed to connect pain storage SQLite pool");