Skip to content

Commit

Permalink
fix database being copied everytime it opens the app
Browse files Browse the repository at this point in the history
  • Loading branch information
samluiz committed May 28, 2024
1 parent 453f79e commit 52442c6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions backend/db/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@ func createCurrentVersionDir(homeDir string, version string) error {
}
}

if previousVersionPath != "" {
err = copyPreviousDatabase(homeDir, version, previousVersionPath)
if _, err := os.Stat(filepath.Join(homeDir, ".dolphin", version, "database.db")); os.IsNotExist(err) {
if previousVersionPath != "" {
err = copyPreviousDatabase(homeDir, version, previousVersionPath)

if err != nil {
return err
}
if err != nil {
return err
}

return nil
return nil
}
}

return nil
Expand Down

0 comments on commit 52442c6

Please sign in to comment.