diff --git a/.changelog/1152.bugfix.md b/.changelog/1152.bugfix.md new file mode 100644 index 000000000..c37334dcf --- /dev/null +++ b/.changelog/1152.bugfix.md @@ -0,0 +1 @@ +Do not change runtime to Emerald when switching network diff --git a/src/app/components/ParaTimePicker/index.tsx b/src/app/components/ParaTimePicker/index.tsx index b194808bb..0f1838928 100644 --- a/src/app/components/ParaTimePicker/index.tsx +++ b/src/app/components/ParaTimePicker/index.tsx @@ -91,8 +91,10 @@ const ParaTimePickerContent: FC = ({ isOutOfDate, on ParaTimePickerTabletStep.ParaTimeDetails, ) const selectNetwork = (newNetwork: Network) => { + const enabledLayers = RouteUtils.getEnabledLayersForNetwork(newNetwork) + const targetLayer = enabledLayers.includes(selectedLayer) ? selectedLayer : enabledLayers[0] setSelectedNetwork(newNetwork) - setSelectedLayer(RouteUtils.getEnabledLayersForNetwork(newNetwork)[0]) + setSelectedLayer(targetLayer) } const handleConfirm = () => onConfirm(selectedNetwork, selectedLayer)