Skip to content

Commit d891574

Browse files
committed
Tolerate same target on changeEthMultiClient
1 parent 80764d3 commit d891574

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

build/src/src/modules/ethClient/changeEthMultiClient.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ export async function changeEthMultiClient(
1818
userSettings?: UserSettings
1919
): Promise<void> {
2020
const prevTarget = db.ethClientTarget.get();
21-
if (prevTarget === nextTarget) throw Error("Same target");
2221

2322
// Set user settings of next target if any
2423
if (userSettings) db.ethClientUserSettings.set(nextTarget, userSettings);
2524

2625
// If the previous client is a client package, uninstall it
27-
if (prevTarget && prevTarget !== "remote") {
26+
if (prevTarget !== nextTarget && prevTarget && prevTarget !== "remote") {
2827
try {
2928
const clientData = ethClientData[prevTarget];
3029
if (clientData) {
@@ -40,7 +39,7 @@ export async function changeEthMultiClient(
4039

4140
// Setting the status to selected will trigger an install
4241
db.ethClientTarget.set(nextTarget);
43-
if (nextTarget !== "remote") {
42+
if (prevTarget !== nextTarget && nextTarget !== "remote") {
4443
db.ethClientInstallStatus.set(nextTarget, { status: "TO_INSTALL" });
4544
eventBus.runEthClientInstaller.emit();
4645
}

0 commit comments

Comments
 (0)