Skip to content
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

refactor: Simplify handleNetworkSwitch helper #6878

Merged
merged 1 commit into from
Jul 27, 2023

Commits on Jul 27, 2023

  1. refactor: Simplify handleNetworkSwitch helper

    The `handleNetworkSwitch` helper function no longer requires the
    `frequentRpcList` state as a parameter. Instead it takes a reference to
    the `PreferencesController`, and gets the RPC list state from that.
    
    Typically it would be preferrable to reference controller state from
    Redux rather than accesing it directly from the Engine global. However,
    this function will be called from non-UI contexts, so it has to get
    controller state from global context regardless.
    
    This change was done to simplify PR #6872, which is part of
    MetaMask/mobile-planning#798
    Gudahtt committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    21f6bd4 View commit details
    Browse the repository at this point in the history