diff --git a/src/app/components/LayerPicker/LayerMenu.tsx b/src/app/components/LayerPicker/LayerMenu.tsx index 523c43fe2..a8420a036 100644 --- a/src/app/components/LayerPicker/LayerMenu.tsx +++ b/src/app/components/LayerPicker/LayerMenu.tsx @@ -11,7 +11,7 @@ import { Layer } from '../../../oasis-nexus/api' import { getLayerLabels } from '../../utils/content' import { RouteUtils } from '../../utils/route-utils' import { Network } from '../../../types/network' -import { orderByLayer } from '../../../types/layers' +import { isLayerHidden, orderByLayer } from '../../../types/layers' import { useScreenSize } from '../../hooks/useScreensize' type BaseLayerMenuItemProps = { @@ -109,6 +109,7 @@ export const LayerMenu: FC = ({ }) => { const [hoveredLayer, setHoveredLayer] = useState() const options = Object.values(Layer) + .filter(layer => !isLayerHidden(layer)) .map(layer => ({ layer, enabled: RouteUtils.getEnabledLayersForNetwork(selectedNetwork || network).includes(layer), diff --git a/src/types/layers.ts b/src/types/layers.ts index 74122df7e..1f4586dd6 100644 --- a/src/types/layers.ts +++ b/src/types/layers.ts @@ -26,6 +26,8 @@ const layerOrder: Record = { [Layer.cipher]: 4, } +const hiddenLayers: Layer[] = [] + export const orderByLayer = (itemA: HasLayer, itemB: HasLayer): number => layerOrder[itemA.layer] - layerOrder[itemB.layer] @@ -36,3 +38,5 @@ export const doesLayerSupportEncryptedTransactions = (layer: Layer): boolean => export const doesAnyOfTheseLayersSupportEncryptedTransactions = (layers: Layer[] | undefined): boolean => uniq(layers).some(doesLayerSupportEncryptedTransactions) + +export const isLayerHidden = (layer: Layer): boolean => hiddenLayers.includes(layer)