diff --git a/main.js b/main.js index 49508a4..66ff328 100644 --- a/main.js +++ b/main.js @@ -32,11 +32,23 @@ if (process.env.THESEUS_USER_DATA) { catch (e) { console.warn("profile relocation failed:", e?.message); } } function relocateProfile(appData) { - const oldDir = path.join(appData, "Theseus Navigator"); const newDir = path.join(appData, "Theseus"); - if (!fs.existsSync(newDir) && fs.existsSync(oldDir)) { - try { fs.renameSync(oldDir, newDir); } - catch { fs.cpSync(oldDir, newDir, { recursive: true }); } + // Two possible previous locations: "Theseus Navigator" (what the code + // originally checked for, based on the assumed productName), and + // "theseus-navigator" (what Electron ACTUALLY used because package.json + // has no top-level productName, so app.getName() falls back to the "name" + // field). Whichever exists is the profile the user has been running + // against; migrate it in place so 0.3.51 does not silently create a fresh + // Theseus\ next to a still-populated old dir the user cannot see. + if (fs.existsSync(newDir)) return newDir; + for (const candidate of ["Theseus Navigator", "theseus-navigator"]) { + const oldDir = path.join(appData, candidate); + if (!fs.existsSync(oldDir)) continue; + try { fs.renameSync(oldDir, newDir); return newDir; } + catch { + try { fs.cpSync(oldDir, newDir, { recursive: true }); return newDir; } + catch (e) { console.warn(`[profile] relocate ${candidate} failed:`, e?.message); } + } } return newDir; } diff --git a/package-lock.json b/package-lock.json index 19383f7..f46e67b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "theseus-navigator", - "version": "0.3.50", + "version": "0.3.51", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "theseus-navigator", - "version": "0.3.50", + "version": "0.3.51", "dependencies": { "@bch-wc2/interfaces": "^0.0.16", "@bitauth/libauth": "^3.1.0-next.8", diff --git a/package.json b/package.json index 39ca269..23b7d44 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "theseus-navigator", - "version": "0.3.50", + "version": "0.3.51", "description": "Theseus Navigator — a browser that follows the thread. By Silent Mode, a Deviant project.", "author": "Silent Mode", "main": "main.js",