Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions packages/desktop-electron/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ async function initialize() {
})

if (needsMigration) {
await sqliteDone?.promise
await Promise.race([
sqliteDone?.promise,
delay(30_000),
])
}

await Promise.race([
Expand Down Expand Up @@ -182,7 +185,10 @@ async function initialize() {
setInitStep({ phase: "done" })

if (overlay) {
await loadingComplete.promise
await Promise.race([
loadingComplete.promise,
delay(10_000),
])
}

mainWindow = createMainWindow(globals)
Expand Down Expand Up @@ -301,8 +307,14 @@ async function getSidecarPort() {

function sqliteFileExists() {
const xdg = process.env.XDG_DATA_HOME
const base = xdg && xdg.length > 0 ? xdg : join(homedir(), ".local", "share")
return existsSync(join(base, "opencode", "opencode.db"))
const base =
xdg && xdg.length > 0
? xdg
: process.platform === "win32"
? join(process.env.APPDATA || homedir(), "opencode")
: join(homedir(), ".local", "share", "opencode")
const dbPath = process.platform === "win32" ? join(base, "opencode.db") : join(base, "opencode", "opencode.db")
return existsSync(dbPath)
}

function setupAutoUpdater() {
Expand Down
Loading