Skip to content

Commit

Permalink
Fix createInitialAutosaveFile error in desktop in v2.12.2 (#4469)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jun 26, 2024
1 parent 3091e05 commit be68f84
Show file tree
Hide file tree
Showing 2 changed files with 419 additions and 589 deletions.
10 changes: 5 additions & 5 deletions products/jbrowse-desktop/electron/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ ipcMain.handle(
'createInitialAutosaveFile',
async (_event: unknown, snap: SessionSnap) => {
const rows = await readRecentSessions()
const idx = rows.findIndex(r => r.path === path)
const path = getAutosavePath(`${+Date.now()}`)
const autosavePath = getAutosavePath(`${+Date.now()}`)
const idx = rows.findIndex(r => r.path === autosavePath)
const entry = {
path,
path: autosavePath,
updated: +Date.now(),
name: snap.defaultSession?.name,
}
Expand All @@ -406,10 +406,10 @@ ipcMain.handle(
}
await Promise.all([
writeFile(recentSessionsPath, stringify(rows)),
writeFile(path, stringify(snap)),
writeFile(autosavePath, stringify(snap)),
])

return path
return autosavePath
},
)

Expand Down
Loading

0 comments on commit be68f84

Please sign in to comment.