From 3a4e791f067e9498bbd3e5df5c2bb4bd8ebfa30f Mon Sep 17 00:00:00 2001 From: Yun Date: Wed, 31 Jul 2024 07:52:32 -1000 Subject: [PATCH] Fix warnings (#528) * Fix build warnings * pnpm format --- .../src/components/DeploymentRequired.tsx | 8 +++- .../keychain/src/components/Execute/index.tsx | 2 +- packages/keychain/src/components/Funding.tsx | 2 +- .../src/components/connect/CreateSession.tsx | 13 +++-- packages/keychain/src/hooks/deploy.ts | 37 +++++++------- .../keychain/src/pages/slot/session/index.tsx | 9 +--- .../src/components/primitives/command.tsx | 2 +- .../components/primitives/toggle-group.tsx | 4 +- packages/ui-next/src/themes/dark.css | 46 +++++++++--------- packages/ui-next/src/themes/default.css | 48 +++++++++---------- 10 files changed, 89 insertions(+), 82 deletions(-) diff --git a/packages/keychain/src/components/DeploymentRequired.tsx b/packages/keychain/src/components/DeploymentRequired.tsx index c274d0830..d09cf60be 100644 --- a/packages/keychain/src/components/DeploymentRequired.tsx +++ b/packages/keychain/src/components/DeploymentRequired.tsx @@ -45,7 +45,13 @@ export function DeploymentRequired({ setDeployHash(hash); }) .catch((e) => setError(e)); - }, [account.chainId, account.username]); + }, [ + account.chainId, + account.username, + hasPrefundRequest, + isDeployed, + deployRequest, + ]); if (isDeployed) { return <>{children}; diff --git a/packages/keychain/src/components/Execute/index.tsx b/packages/keychain/src/components/Execute/index.tsx index 9bbacf01b..dc1cf7f4f 100644 --- a/packages/keychain/src/components/Execute/index.tsx +++ b/packages/keychain/src/components/Execute/index.tsx @@ -128,7 +128,7 @@ export function Execute() { transaction_hash, code: ResponseCodes.SUCCESS, }); - }, [account, calls, fees, ctx, origin, controller]); + }, [account, calls, ctx, origin, controller]); const policies = useMemo( () => diff --git a/packages/keychain/src/components/Funding.tsx b/packages/keychain/src/components/Funding.tsx index 06783d17a..056527f76 100644 --- a/packages/keychain/src/components/Funding.tsx +++ b/packages/keychain/src/components/Funding.tsx @@ -154,7 +154,7 @@ function FundingInner({ onComplete }: FundingInnerProps) { setError(e); } - }, [onComplete]); + }, [onComplete, deploySelf]); const onCopy = useCallback(() => { navigator.clipboard.writeText(controller.address); diff --git a/packages/keychain/src/components/connect/CreateSession.tsx b/packages/keychain/src/components/connect/CreateSession.tsx index f81b12216..3c7d2e036 100644 --- a/packages/keychain/src/components/connect/CreateSession.tsx +++ b/packages/keychain/src/components/connect/CreateSession.tsx @@ -26,9 +26,9 @@ export function CreateSession({ await controller.approve(origin, expiresAt, policies, maxFees); onConnect(policies); } catch (e) { - setError(e) - setIsConnecting(false) - } + setError(e); + setIsConnecting(false); + } }, [controller, origin, expiresAt, policies, maxFees, onConnect]); return ( @@ -52,13 +52,16 @@ export function CreateSession({