Skip to content

Commit

Permalink
fix(settings): fix setNimbusProxyConfigEnabled in the settings
Browse files Browse the repository at this point in the history
fixes #12918 (part 3/4)
  • Loading branch information
friofry committed May 29, 2024
1 parent 056310e commit 93285d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ proc isNimbusProxyEnabled*(self: Controller): bool =
proc toggleNimbusProxy*(self: Controller) =
let enabled = self.nodeConfigurationService.isNimbusProxyEnabled()

if(not self.nodeConfigurationService.setNimbusProxyConfig(not enabled)):
if not self.nodeConfigurationService.setNimbusProxyConfigEnabled(not enabled):
error "an error occurred, we couldn't toggle nimbus proxy"
return

Expand Down
9 changes: 5 additions & 4 deletions src/app_service/service/node_configuration/service.nim
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,11 @@ proc getNimbusProxyConfig(self: Service): bool =
proc isNimbusProxyEnabled*(self: Service): bool =
return self.getNimbusProxyConfig()

proc setNimbusProxyConfig*(self: Service, value: bool): bool =
var newConfiguration = self.configuration
newConfiguration.NimbusProxyConfig.Enabled = value
return self.saveConfiguration(newConfiguration)
proc setNimbusProxyConfigEnabled*(self: Service, enabled: bool): bool =
# FIXME: call status-go API to update NodeConfig
# when this is merged https://github.com/status-im/status-go/pull/4254
self.configuration.NimbusProxyConfig.Enabled = enabled
return true

proc isLightClient*(self: Service): bool =
return self.configuration.WakuV2Config.LightClient
Expand Down
2 changes: 1 addition & 1 deletion src/backend/node_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ proc setLightClient*(enabled: bool): RpcResponse[JsonNode] =
let payload = %*[{
"enabled": enabled
}]
result = callRPCMethod("setLightClient", payload)
result = callRPCMethod("setLightClient", payload)

0 comments on commit 93285d8

Please sign in to comment.