Skip to content

Commit

Permalink
Fix controller fromStore
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Aug 9, 2024
1 parent c84f2b8 commit 4482f5c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/keychain/src/hooks/connection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function ConnectionProvider({ children }: PropsWithChildren) {
const [rpcUrl, setRpcUrl] = useState<string>();
const [chainId, setChainId] = useState<string>();
const [policies, setPolicies] = useState<Policy[]>([]);
const [controller, setController] = useState(Controller.fromStore);
const [controller, setController] = useState<Controller | undefined>();
const [prefunds, setPrefunds] = useState<Prefund[]>([]);
const [hasPrefundRequest, setHasPrefundRequest] = useState<boolean>(false);
const [error, setError] = useState<Error>();
Expand Down
2 changes: 1 addition & 1 deletion packages/keychain/src/pages/slot/auth/consent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
4 changes: 2 additions & 2 deletions packages/keychain/src/utils/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 4482f5c

Please sign in to comment.