Skip to content

Commit

Permalink
Convert action creator to simpler async function
Browse files Browse the repository at this point in the history
  • Loading branch information
Gudahtt authored and darkwing committed Jun 28, 2024
1 parent 33a9ebe commit 1cfb4ab
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions ui/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2494,22 +2494,15 @@ export function setActiveNetwork(
};
}

export function setActiveNetworkConfigurationId(
export async function setActiveNetworkConfigurationId(
networkConfigurationId: string,
): ThunkAction<void, MetaMaskReduxState, unknown, AnyAction> {
return async (dispatch) => {
log.debug(
`background.setActiveNetworkConfigurationId: ${networkConfigurationId}`,
);
try {
await submitRequestToBackground('setActiveNetworkConfigurationId', [
networkConfigurationId,
]);
} catch (error) {
logErrorWithMessage(error);
dispatch(displayWarning('Had a problem changing networks!'));
}
};
): Promise<undefined> {
log.debug(
`background.setActiveNetworkConfigurationId: ${networkConfigurationId}`,
);
await submitRequestToBackground('setActiveNetworkConfigurationId', [
networkConfigurationId,
]);
}

export function rollbackToPreviousProvider(): ThunkAction<
Expand Down

0 comments on commit 1cfb4ab

Please sign in to comment.