Skip to content

Commit

Permalink
chore: add comments explaining the two checks on notMainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
alexruzenhack committed Nov 1, 2023
1 parent bbb8f5d commit f31c263
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/NetworkSettings/NetworkStatusBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ import { PRE_SETTINGS_MAINNET } from '../../constants';
const customNetworkText = t`Custom network`;

function notMainnet(networkSettings) {
// If the networkSettings has a walletServiceUrl, then
// we should run a full check against the mainnet presettings.
// This is important because the wallet service has precedence
// over fullnode.
if (networkSettings.walletServiceUrl) {
return !isEqual(networkSettings, PRE_SETTINGS_MAINNET);
}

// In the absence of walletServiceUrl we can remove wallet
// service URLs from the equality check against the mainnet
// presettings.
const currNetwork = {
stage: networkSettings.stage,
network: networkSettings.network,
Expand Down

0 comments on commit f31c263

Please sign in to comment.