fix: can unset network#proxy in the CLI config

An empty object (`{}`) must be used to correctly unset the CLI config
value to its default.

Closes arduino/arduino-ide#2184

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta
2023-08-22 13:17:22 +02:00
committed by Akos Kitta
parent 8e09971078
commit 347e3d8118
2 changed files with 179 additions and 1 deletions

View File

@@ -95,7 +95,7 @@ export class ConfigServiceImpl
};
copyDefaultCliConfig.locale = locale || 'en';
const proxy = Network.stringify(network);
copyDefaultCliConfig.network = { proxy };
copyDefaultCliConfig.network = proxy ? { proxy } : {}; // must be an empty object to unset the default prop with the `WriteRequest`.
// always use the port of the daemon
const port = await this.daemon.getPort();