Skip to content

Commit

Permalink
Prevent default rpc deletion (#1249)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobar79 authored Dec 20, 2023
1 parent 5a22ac4 commit c5d742f
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions src/entries/popup/pages/settings/rpcs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ export function SettingsNetworksRPCs() {
{mainnetChains.map((chain, index) => (
<Box key={`${chain.name}`} width="full">
<ContextMenu>
<ContextMenuTrigger>
<ContextMenuTrigger
disabled={
mainnetChains[index].name === supportedChain?.name
}
>
<MenuItem
first={!supportedChain && index === 0}
leftComponent={
Expand Down Expand Up @@ -367,7 +371,12 @@ export function SettingsNetworksRPCs() {
{testnetChains.map((chain, index) => (
<Box key={`${chain.name}`} testId={`network-row-${chain.name}`}>
<ContextMenu>
<ContextMenuTrigger>
<ContextMenuTrigger
disabled={
chainIdMap[chainId]?.includes(chain.id) &&
chain.id !== chainId
}
>
<MenuItem
first={!supportedChain && index === 0}
leftComponent={
Expand Down Expand Up @@ -409,14 +418,14 @@ export function SettingsNetworksRPCs() {
</Menu>
) : null}

{featureFlags.custom_rpc &&
Object.values(customNetworkAssetsForChain || {}).length ? (
<Menu>
<Box padding="20px">
<Stack space="14px">
<Text align="left" color="label" size="14pt" weight="medium">
{i18n.t('settings.networks.custom_rpc.tokens')}
</Text>
{featureFlags.custom_rpc &&
Object.values(customNetworkAssetsForChain || {}).length ? (
<Menu>
<Box padding="20px">
<Stack space="14px">
<Text align="left" color="label" size="14pt" weight="medium">
{i18n.t('settings.networks.custom_rpc.tokens')}
</Text>
<Box width="full">
{customNetworkAssetsForChain?.map((asset, i) => (
<ContextMenu key={i}>
Expand Down

0 comments on commit c5d742f

Please sign in to comment.