Skip to content

Commit

Permalink
fix: wait for wallet client
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkvasnicak committed Dec 10, 2024
1 parent 37e92a6 commit 12c61e3
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions packages/debugger/app/components/frame-app-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export function FrameAppDialog({
const { name, url, splashImageUrl, splashBackgroundColor } =
frameState.frame.button.action;

const isLoadingWallet = walletClient.status === "pending";
const isLoading = isLoadingWallet || !isReady;

return (
<Dialog
open
Expand All @@ -70,7 +73,7 @@ export function FrameAppDialog({
<DialogTitle>{frameState.frame.button.action.name}</DialogTitle>
</DialogHeader>
<div className="relative">
{!isReady && (
{isLoading && (
<div
className={cn(
"bg-white flex items-center justify-center absolute top-0 bottom-0 left-0 right-0"
Expand All @@ -93,12 +96,14 @@ export function FrameAppDialog({
</div>
</div>
)}
<iframe
className="h-[600px] w-full opacity-100 transition-opacity duration-300"
onLoad={frameApp.onLoad}
src={url}
sandbox="allow-forms allow-scripts allow-same-origin"
></iframe>
{!isLoadingWallet && (
<iframe
className="h-[600px] w-full opacity-100 transition-opacity duration-300"
onLoad={frameApp.onLoad}
src={url}
sandbox="allow-forms allow-scripts allow-same-origin"
></iframe>
)}
</div>
{primaryButton && !primaryButton.hidden && (
<DialogFooter>
Expand Down

0 comments on commit 12c61e3

Please sign in to comment.