-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Fix issue with manually added networks #22832
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
Changes from all commits
4246a17
2c0adcb
d07717c
6d5b587
9e62e01
8921af5
3c770ff
534f10f
bc198f5
72b5268
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,7 @@ const prefixChainId = (chainId) => { | |
|
|
||
| const NetworksForm = ({ | ||
| addNewNetwork, | ||
| setActiveOnSubmit = false, | ||
| restrictHeight, | ||
| isCurrentRpcTarget, | ||
| networksToRender, | ||
|
|
@@ -605,20 +606,11 @@ const NetworksForm = ({ | |
| }, | ||
| }, | ||
| { | ||
| setActive: true, | ||
| setActive: setActiveOnSubmit, | ||
| source: MetaMetricsNetworkEventSource.CustomNetworkForm, | ||
| }, | ||
| ), | ||
| ); | ||
| } | ||
| if (addNewNetwork) { | ||
| dispatch( | ||
| setNewNetworkAdded({ | ||
| nickname: networkName, | ||
| networkConfigurationId, | ||
| }), | ||
| ); | ||
|
|
||
| trackEvent({ | ||
| event: MetaMetricsEventName.CustomNetworkAdded, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This event is only called now when a network is added, not when an existing network is edited. |
||
| category: MetaMetricsEventCategory.Network, | ||
|
|
@@ -631,9 +623,17 @@ const NetworksForm = ({ | |
| token_symbol: ticker, | ||
| }, | ||
| }); | ||
| } | ||
|
|
||
| submitCallback?.(); | ||
| if (addNewNetwork && !setActiveOnSubmit) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
| dispatch( | ||
| setNewNetworkAdded({ | ||
| nickname: networkName, | ||
| networkConfigurationId, | ||
| }), | ||
| ); | ||
| } | ||
| submitCallback?.(); | ||
| } catch (error) { | ||
| setIsSubmitting(false); | ||
| throw error; | ||
|
|
@@ -846,6 +846,7 @@ NetworksForm.propTypes = { | |
| cancelCallback: PropTypes.func, | ||
| submitCallback: PropTypes.func, | ||
| restrictHeight: PropTypes.bool, | ||
| setActiveOnSubmit: PropTypes.bool, | ||
| }; | ||
|
|
||
| NetworksForm.defaultProps = { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.