fix(electron): fix data migration path mismatch after package extraction

The extraction of Electron code to apps/desktop/ changed the package name
from "ChatLab" to "@openchatlab/desktop", which caused app.getPath('userData')
to return a wrong path in dev mode. This made the migration system unable to
find existing databases, resulting in a fresh-app experience for upgrading users.

- Add productName "ChatLab" to desktop package.json to ensure correct userData path
- Add verifyDataPath() safety net: auto-correct config.toml when configured dir
  has no databases but old Electron path does
This commit is contained in:
digua committed 2026-05-19 20:39:25 +08:00
1 parent 1c6f4b3776
commit ba851f4ae9
3 files changed
+35

No files matched your search

+1
View File
@@ -1,6 +1,7 @@
{
"name": "@openchatlab/desktop",
"version": "0.19.0",
"productName": "ChatLab",
"private": true,
"description": "ChatLab Desktop — Electron 桌面客户端",
"main": "./out/main/index.js",