Skip to content

Commit 104b0d8

Browse files
fix: properly set frame app context on reload (#541)
1 parent 9bc8cb2 commit 104b0d8

File tree

5 files changed

+505
-449
lines changed

5 files changed

+505
-449
lines changed

.changeset/popular-bats-relate.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@frames.js/debugger": patch
3+
---
4+
5+
fix: properly set frame app context on reload

packages/debugger/app/components/frame-app-debugger-notifications.tsx

+8-3
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@ import { isValidPartialFrameV2 } from "@frames.js/render/ui/utils";
1919
import type { FarcasterSigner } from "@frames.js/render/identity/farcaster";
2020

2121
type FrameAppDebuggerNotificationsProps = {
22-
frameApp: Extract<UseFrameAppInIframeReturn, { status: "success" }>;
22+
frameApp: UseFrameAppInIframeReturn | null;
2323
farcasterSigner: FarcasterSigner | null;
2424
};
2525

2626
export function FrameAppDebuggerNotifications({
2727
frameApp,
2828
farcasterSigner,
2929
}: FrameAppDebuggerNotificationsProps) {
30-
const frame = frameApp.frame;
3130
const frameAppNotificationManager = useFrameAppNotificationsManagerContext();
3231
const [events, setEvents] = useState<Message[]>([]);
3332
const notificationsQuery = useQuery({
@@ -102,7 +101,13 @@ export function FrameAppDebuggerNotifications({
102101
}
103102
}, [notificationsQuery.data]);
104103

105-
if (!isValidPartialFrameV2(frameApp.frame)) {
104+
if (!frameApp || frameApp.status !== "success") {
105+
return null;
106+
}
107+
108+
const frame = frameApp.frame;
109+
110+
if (!isValidPartialFrameV2(frame)) {
106111
return (
107112
<>
108113
<Alert variant="destructive">

0 commit comments

Comments
 (0)