Console: Fix saving flat clients.config file

when in portable configuration and changing the
launch browser on startup setting on /configservice
ref: http://zzz.i2p/topics/3347
This commit is contained in:
zzz
2022-07-21 09:19:25 -04:00
parent af8272b970
commit 69adf84363

View File

@@ -363,10 +363,15 @@ public class ConfigServiceHandler extends FormHandler {
String url = _context.portMapper().getConsoleURL();
ca = new ClientAppConfig(UrlLauncher.class.getName(), "consoleBrowser",
url, 5, false);
clients.add(ca);
}
try {
if (ca != null)
ClientAppConfig.writeClientAppConfig(_context, ca);
if (ca != null) {
if (ClientAppConfig.isSplitConfig(_context))
ClientAppConfig.writeClientAppConfig(_context, ca);
else
ClientAppConfig.writeClientAppConfig(_context, clients);
}
addFormNotice(_t("Configuration saved successfully"));
} catch (IOException ioe) {
addFormError(_t("Error saving the configuration (applied but not saved) - please see the error logs"));