Skip to content

Commit adb0c4d

Browse files
committed
desktop: only show loading window if sqlite migration is necessary
1 parent 991496a commit adb0c4d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • packages/desktop/src-tauri/src

packages/desktop/src-tauri/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ async fn initialize(app: AppHandle) {
566566
// come from any invocation of the sidecar CLI. The progress is captured by a stdout stream interceptor.
567567
// Then in the loading task, we wait for sqlite migration to complete before
568568
// starting our health check against the server, otherwise long migrations could result in a timeout.
569-
let sqlite_enabled = option_env!("OPENCODE_SQLITE").is_some();
570-
let sqlite_done = (sqlite_enabled && !sqlite_file_exists()).then(|| {
569+
let needs_sqlite_migration = option_env!("OPENCODE_SQLITE").is_some() && !sqlite_file_exists();
570+
let sqlite_done = needs_sqlite_migration.then(|| {
571571
tracing::info!(
572572
path = %opencode_db_path().expect("failed to get db path").display(),
573573
"Sqlite file not found, waiting for it to be generated"
@@ -670,7 +670,7 @@ async fn initialize(app: AppHandle) {
670670
.map_err(|_| ())
671671
.shared();
672672

673-
let loading_window = if sqlite_enabled
673+
let loading_window = if needs_sqlite_migration
674674
&& timeout(Duration::from_secs(1), loading_task.clone())
675675
.await
676676
.is_err()

0 commit comments

Comments
 (0)