Skip to content

Commit

Permalink
Merge pull request #1152 from oasisprotocol/mz/picker
Browse files Browse the repository at this point in the history
Do not change runtime to Emerald when switching network
  • Loading branch information
buberdds authored Jan 16, 2024
2 parents a2ebc54 + f7e5186 commit 403445b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changelog/1152.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not change runtime to Emerald when switching network
4 changes: 3 additions & 1 deletion src/app/components/ParaTimePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ const ParaTimePickerContent: FC<ParaTimePickerContentProps> = ({ 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)

Expand Down

0 comments on commit 403445b

Please sign in to comment.