Skip to content

Commit

Permalink
fix: avoid mutation sealed param object
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrsoares committed Jan 17, 2024
1 parent de34ddf commit 9011c74
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
5 changes: 0 additions & 5 deletions apps/maestro/src/config/next-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ export const NEXT_AUTH_OPTIONS: NextAuthOptions = {
kvClient.getAccountStatus(address),
]);

console.log({
accountStatus,
accountNonce,
});

if (accountNonce === null || accountStatus === "disabled") {
if (accountStatus === "disabled") {
const { ip, userAgent } = Maybe.of(req.headers).mapOr(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ function useCanonicalTokenDeploymentState(
}

setState((draft) => {
draft.step = partialInitialState.step ?? draft.step;
if (partialInitialState.step !== undefined && !draft.step) {
draft.step = partialInitialState.step;
}
draft.tokenDetails = {
...draft.tokenDetails,
...partialInitialState.tokenDetails,
Expand All @@ -84,11 +86,13 @@ function useCanonicalTokenDeploymentState(
},
actions: {
reset: () => {
console.log("reset");
setState((draft) => {
Object.assign(draft, initialState);
});
},
setTokenDetails: (detatils: Partial<TokenDetails>) => {
console.log("setTokenDetails", detatils);
setState((draft) => {
draft.tokenDetails = {
...draft.tokenDetails,
Expand All @@ -103,7 +107,11 @@ function useCanonicalTokenDeploymentState(
txState.type === "deployed"
) {
// retain txHash from deploying state
txState.txHash = draft.txState.txHash;
draft.txState = {
...txState,
txHash: draft.txState.txHash,
};
return;
}

draft.txState = txState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ function useInterchainTokenDeploymentState(
txState.type === "deployed"
) {
// retain txHash from deploying state
txState.txHash = draft.txState.txHash;
draft.txState = {
...txState,
txHash: draft.txState.txHash,
};
return;
}

draft.txState = txState;
Expand Down

2 comments on commit 9011c74

@vercel
Copy link

@vercel vercel bot commented on 9011c74 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
ui.axelar.dev
axelar-ui-axelar-network.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 9011c74 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.