fix(lite): give the lite variant its own config folder (ObsidianDragonLite)
Both variants hardcoded "ObsidianDragon" as the per-user config folder (settings.json, themes, the lite_rollout cache), so the lite app and the full-node app shared one settings.json. That cross-variant pollution can leave the lite server selection in a bad state — and since openWallet() contacts the selected lightwalletd server, a wrong/empty server URL there makes an existing wallet fail to open (a silent "disconnected" spinner). Use DRAGONX_APP_NAME (already "ObsidianDragon" / "ObsidianDragonLite" per variant) for the config-dir name in Settings::getDefaultPath, Platform::getConfigDir and getObsidianDragonDir (and the theme-setup exe-name probe). Full-node is unchanged; lite now reads/writes %APPDATA%\ObsidianDragonLite (and ~/.config/ObsidianDragonLite), so it starts from a clean, isolated config and uses default servers. Note: the lite wallet file itself lives in the litelib backend's own data dir (unaffected); this isolates the GUI config only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -64,7 +64,7 @@ std::string Settings::getDefaultPath()
|
||||
#ifdef _WIN32
|
||||
char path[MAX_PATH];
|
||||
if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL, 0, path))) {
|
||||
std::string dir = std::string(path) + "\\ObsidianDragon";
|
||||
std::string dir = std::string(path) + "\\" DRAGONX_APP_NAME;
|
||||
fs::create_directories(dir);
|
||||
return dir + "\\settings.json";
|
||||
}
|
||||
@@ -75,7 +75,7 @@ std::string Settings::getDefaultPath()
|
||||
struct passwd* pw = getpwuid(getuid());
|
||||
home = pw->pw_dir;
|
||||
}
|
||||
std::string dir = std::string(home) + "/Library/Application Support/ObsidianDragon";
|
||||
std::string dir = std::string(home) + "/Library/Application Support/" DRAGONX_APP_NAME;
|
||||
fs::create_directories(dir);
|
||||
return dir + "/settings.json";
|
||||
#else
|
||||
@@ -84,7 +84,7 @@ std::string Settings::getDefaultPath()
|
||||
struct passwd* pw = getpwuid(getuid());
|
||||
home = pw->pw_dir;
|
||||
}
|
||||
std::string dir = std::string(home) + "/.config/ObsidianDragon";
|
||||
std::string dir = std::string(home) + "/.config/" DRAGONX_APP_NAME;
|
||||
fs::create_directories(dir);
|
||||
return dir + "/settings.json";
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user