diff options
| author | Brendan Allan <[email protected]> | 2026-02-13 08:49:52 +0800 |
|---|---|---|
| committer | Brendan Allan <[email protected]> | 2026-02-13 08:49:52 +0800 |
| commit | adb0c4d4f94f6260a67bb9a48ef3a7faa6042bf3 (patch) | |
| tree | 9eb6a3ecf3a7a8de9bdddea8c6c689b1f066c1ce /packages/desktop/src-tauri | |
| parent | 991496a753545f2705072d4da537c175dca357e6 (diff) | |
| download | opencode-adb0c4d4f94f6260a67bb9a48ef3a7faa6042bf3.tar.gz opencode-adb0c4d4f94f6260a67bb9a48ef3a7faa6042bf3.zip | |
desktop: only show loading window if sqlite migration is necessary
Diffstat (limited to 'packages/desktop/src-tauri')
| -rw-r--r-- | packages/desktop/src-tauri/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/desktop/src-tauri/src/lib.rs b/packages/desktop/src-tauri/src/lib.rs index bec72c04f..fe71ef029 100644 --- a/packages/desktop/src-tauri/src/lib.rs +++ b/packages/desktop/src-tauri/src/lib.rs @@ -566,8 +566,8 @@ async fn initialize(app: AppHandle) { // come from any invocation of the sidecar CLI. The progress is captured by a stdout stream interceptor. // Then in the loading task, we wait for sqlite migration to complete before // starting our health check against the server, otherwise long migrations could result in a timeout. - let sqlite_enabled = option_env!("OPENCODE_SQLITE").is_some(); - let sqlite_done = (sqlite_enabled && !sqlite_file_exists()).then(|| { + let needs_sqlite_migration = option_env!("OPENCODE_SQLITE").is_some() && !sqlite_file_exists(); + let sqlite_done = needs_sqlite_migration.then(|| { tracing::info!( path = %opencode_db_path().expect("failed to get db path").display(), "Sqlite file not found, waiting for it to be generated" @@ -670,7 +670,7 @@ async fn initialize(app: AppHandle) { .map_err(|_| ()) .shared(); - let loading_window = if sqlite_enabled + let loading_window = if needs_sqlite_migration && timeout(Duration::from_secs(1), loading_task.clone()) .await .is_err() |
