Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(entrykit): don't call decorator #3440

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/entrykit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@rainbow-me/rainbowkit": "2.1.7",
"debug": "^4.3.4",
"dotenv": "^16.0.3",
"permissionless": "^0.2.3",
"permissionless": "0.2.25",
"react-error-boundary": "^4.0.13",
"react-merge-refs": "^2.1.1",
"tailwind-merge": "^1.12.0",
Expand Down
9 changes: 5 additions & 4 deletions packages/entrykit/src/getSessionClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ export async function getSessionClient<chain extends Chain>({
worldAddress: Address;
}): Promise<SessionClient<chain>> {
const bundlerTransport = getBundlerTransport(client.chain);

const sessionClient = createBundlerClient({
const bundlerClient = createBundlerClient({
transport: bundlerTransport,
client,
account: sessionAccount,
})
.extend(smartAccountActions())
});

const sessionClient = bundlerClient
.extend(smartAccountActions)
Copy link
Member Author

Choose a reason for hiding this comment

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

this was the main fix

.extend(callFrom({ worldAddress, delegatorAddress: userAddress, publicClient: client }))
// TODO: add observer once we conditionally fetch receipts while bridge is open
.extend(() => ({ userAddress }));
Expand Down
12 changes: 6 additions & 6 deletions packages/entrykit/src/onboarding/Session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type Props = {
};

export function Session({ isActive, isExpanded, userClient, registerSpender, registerDelegation }: Props) {
const { data: sessionClient } = useSessionClient(userClient.account.address);
const sessionClient = useSessionClient(userClient.account.address);
const setup = useSetupSession({ userClient });
const hasSession = !registerDelegation && !registerDelegation;

Expand All @@ -23,9 +23,9 @@ export function Session({ isActive, isExpanded, userClient, registerSpender, reg
// individual mutations, even though the keys match. And the one we want the status of
// seems to stay pending. This is sorta resolved by triggering this after a timeout.
const timer = setTimeout(() => {
if (isActive && setup.status === "idle" && sessionClient && !hasSession) {
if (isActive && setup.status === "idle" && sessionClient.data && !hasSession) {
setup.mutate({
sessionClient,
sessionClient: sessionClient.data,
registerSpender,
registerDelegation,
});
Expand All @@ -50,12 +50,12 @@ export function Session({ isActive, isExpanded, userClient, registerSpender, reg
variant={isActive ? "primary" : "tertiary"}
className="flex-shrink-0 text-sm p-1 w-28"
autoFocus={isActive}
pending={!sessionClient || setup.status === "pending"}
pending={!sessionClient.data || setup.status === "pending"}
onClick={
sessionClient
sessionClient.data
? () =>
setup.mutate({
sessionClient,
sessionClient: sessionClient.data,
registerSpender,
registerDelegation,
})
Expand Down
14 changes: 8 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading