From 4482f5c84e8eed380e6ef6033c3dbaca538cbf4b Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Fri, 9 Aug 2024 15:46:07 -0400 Subject: [PATCH] Fix controller fromStore --- packages/keychain/src/hooks/connection.tsx | 2 +- packages/keychain/src/pages/slot/auth/consent.tsx | 2 +- packages/keychain/src/utils/controller.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/keychain/src/hooks/connection.tsx b/packages/keychain/src/hooks/connection.tsx index 40f95e8db..3b2a9549f 100644 --- a/packages/keychain/src/hooks/connection.tsx +++ b/packages/keychain/src/hooks/connection.tsx @@ -52,7 +52,7 @@ export function ConnectionProvider({ children }: PropsWithChildren) { const [rpcUrl, setRpcUrl] = useState(); const [chainId, setChainId] = useState(); const [policies, setPolicies] = useState([]); - const [controller, setController] = useState(Controller.fromStore); + const [controller, setController] = useState(); const [prefunds, setPrefunds] = useState([]); const [hasPrefundRequest, setHasPrefundRequest] = useState(false); const [error, setError] = useState(); diff --git a/packages/keychain/src/pages/slot/auth/consent.tsx b/packages/keychain/src/pages/slot/auth/consent.tsx index 7429bea3c..fab74ab30 100644 --- a/packages/keychain/src/pages/slot/auth/consent.tsx +++ b/packages/keychain/src/pages/slot/auth/consent.tsx @@ -23,7 +23,7 @@ function Consent() { }, [router.query.callback_uri]); useEffect(() => { - if (!Controller.fromStore()) { + if (!Controller.fromStore("https://x.cartridge.gg")) { router.replace("/slot/auth"); } }, [router]); diff --git a/packages/keychain/src/utils/controller.ts b/packages/keychain/src/utils/controller.ts index be1f449b0..5f4a38504 100644 --- a/packages/keychain/src/utils/controller.ts +++ b/packages/keychain/src/utils/controller.ts @@ -88,8 +88,8 @@ export default class Controller { }; } - async delegateAccount(origin: string) { - const address = await this.account.cartridge.delegateAccount(origin); + async delegateAccount() { + const address = await this.account.cartridge.delegateAccount(); return num.toHexString(address); }