Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename isprivateConnection to isPrivateConnection #11656

Merged
merged 4 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/components/UI/NetworkModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import NetworkDetails from './NetworkDetails';
import NetworkAdded from './NetworkAdded';
import Engine from '../../../core/Engine';
import {
isprivateConnection,
isPrivateConnection,
toggleUseSafeChainsListValidation,
} from '../../../util/networks';
import getDecimalChainId from '../../../util/networks/getDecimalChainId';
Expand Down Expand Up @@ -186,7 +186,7 @@ const NetworkModals = (props: NetworkProps) => {
const closeModal = () => {
const { NetworkController } = Engine.context;
const url = new URLPARSE(rpcUrl);
!isprivateConnection(url.hostname) && url.set('protocol', 'https:');
!isPrivateConnection(url.hostname) && url.set('protocol', 'https:');
NetworkController.upsertNetworkConfiguration(
{
rpcUrl: url.href,
Expand All @@ -209,7 +209,7 @@ const NetworkModals = (props: NetworkProps) => {
const { NetworkController, CurrencyRateController } = Engine.context;
const url = new URLPARSE(rpcUrl);
CurrencyRateController.updateExchangeRate(ticker);
!isprivateConnection(url.hostname) && url.set('protocol', 'https:');
!isPrivateConnection(url.hostname) && url.set('protocol', 'https:');
NetworkController.upsertNetworkConfiguration(
{
rpcUrl: url.href,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { getNavigationOptionsTitle } from '../../../../UI/Navbar';
import { strings } from '../../../../../../locales/i18n';
import Networks, {
isprivateConnection,
isPrivateConnection,
getAllNetworks,
getIsNetworkOnboarded,
} from '../../../../../util/networks';
Expand Down Expand Up @@ -656,7 +656,7 @@ export class NetworkSettings extends PureComponent {
if (this.validateRpcUrl() && isNetworkExists.length === 0) {
const url = new URL(rpcUrl);

!isprivateConnection(url.hostname) && url.set('protocol', 'https:');
!isPrivateConnection(url.hostname) && url.set('protocol', 'https:');
CurrencyRateController.updateExchangeRate(ticker);
// Remove trailing slashes
NetworkController.upsertNetworkConfiguration(
Expand Down Expand Up @@ -747,7 +747,7 @@ export class NetworkSettings extends PureComponent {
});
}
const url = new URL(rpcUrl);
const privateConnection = isprivateConnection(url.hostname);
const privateConnection = isPrivateConnection(url.hostname);
if (!privateConnection && url.protocol === 'http:') {
this.setState({
warningRpcUrl: strings('app_settings.invalid_rpc_prefix'),
Expand Down
2 changes: 1 addition & 1 deletion app/util/networks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export function hasBlockExplorer(key) {
return key.toLowerCase() !== RPC;
}

export function isprivateConnection(hostname) {
export function isPrivateConnection(hostname) {
return hostname === 'localhost' || regex.localNetwork.test(hostname);
}

Expand Down
Loading