Skip to content

Commit

Permalink
chore: extract condition expression to const
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrsoares committed Jan 17, 2024
1 parent cd5cedc commit c10add0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ function useCanonicalTokenDeploymentState(
}

setState((draft) => {
if (
const shouldUpdateStep =
(partialInitialState.step !== undefined && !draft.step) ||
partialInitialState.tokenDetails?.tokenAddress !==
draft.tokenDetails.tokenAddress
) {
draft.tokenDetails.tokenAddress;

if (shouldUpdateStep) {
draft.step = partialInitialState.step ?? draft.step;
}

draft.tokenDetails = {
...draft.tokenDetails,
...partialInitialState.tokenDetails,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,15 @@ function useInterchainTokenDeploymentState(
}

setState((draft) => {
draft.step = partialInitialState.step ?? draft.step;
const shouldUpdateStep =
(partialInitialState.step !== undefined && !draft.step) ||
partialInitialState.tokenDetails?.tokenAddress !==
draft.tokenDetails.tokenAddress;

if (shouldUpdateStep) {
draft.step = partialInitialState.step ?? draft.step;
}

draft.tokenDetails = {
...draft.tokenDetails,
...partialInitialState.tokenDetails,
Expand Down

2 comments on commit c10add0

@vercel
Copy link

@vercel vercel bot commented on c10add0 Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

axelar-ui – ./packages/ui

axelar-ui.vercel.app
axelar-ui-git-main-axelar-network.vercel.app
axelar-ui-axelar-network.vercel.app
ui.axelar.dev

@vercel
Copy link

@vercel vercel bot commented on c10add0 Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

axelar-registry – ./apps/registry

axelar-registry-git-main-axelar-network.vercel.app
axelar-registry-axelar-network.vercel.app

Please sign in to comment.