@@ -19,7 +19,7 @@ import type {
1919import { useFrameState } from "./unstable-use-frame-state" ;
2020import { useFetchFrame } from "./unstable-use-fetch-frame" ;
2121import { useFreshRef } from "./hooks/use-fresh-ref" ;
22- import { tryCallAsync } from "./helpers" ;
22+ import { tryCall , tryCallAsync } from "./helpers" ;
2323
2424function onErrorFallback ( e : Error ) : void {
2525 console . error ( "@frames.js/render" , e ) ;
@@ -192,6 +192,7 @@ export function useFrame_unstable<
192192 onTransactionProcessingError,
193193 onTransactionProcessingStart,
194194 onTransactionProcessingSuccess,
195+ onMissingSigner,
195196} : UseFrameOptions <
196197 TExtraDataPending ,
197198 TExtraDataDone ,
@@ -249,6 +250,7 @@ export function useFrame_unstable<
249250
250251 const fetchFrameRef = useFreshRef ( fetchFrame ) ;
251252 const onErrorRef = useFreshRef ( onError ) ;
253+ const onMissingSignerRef = useFreshRef ( onMissingSigner ) ;
252254
253255 useEffect ( ( ) => {
254256 if ( ! homeframeUrl ) {
@@ -318,6 +320,7 @@ export function useFrame_unstable<
318320 }
319321
320322 if ( ! currentState . signerState . hasSigner ) {
323+ tryCall ( ( ) => onMissingSignerRef . current ?.( ) ) ;
321324 await currentState . signerState . onSignerlessFramePress ( ) ;
322325 return ;
323326 }
@@ -341,7 +344,7 @@ export function useFrame_unstable<
341344 sourceFrame : currentFrame ,
342345 } ) ;
343346 } ,
344- [ fetchFrameRef , frameStateRef , onErrorRef ]
347+ [ fetchFrameRef , frameStateRef , onErrorRef , onMissingSignerRef ]
345348 ) ;
346349
347350 const resolveAddressRef = useFreshRef ( resolveAddress ) ;
@@ -370,6 +373,7 @@ export function useFrame_unstable<
370373
371374 // Send post request to get calldata
372375 if ( ! currentState . signerState . hasSigner ) {
376+ tryCall ( ( ) => onMissingSignerRef . current ?.( ) ) ;
373377 await currentState . signerState . onSignerlessFramePress ( ) ;
374378 return ;
375379 }
@@ -417,7 +421,7 @@ export function useFrame_unstable<
417421 sourceFrame : currentFrame ,
418422 } ) ;
419423 } ,
420- [ frameStateRef , fetchFrameRef , onErrorRef , resolveAddressRef ]
424+ [ frameStateRef , fetchFrameRef , onErrorRef , onMissingSignerRef , resolveAddressRef ]
421425 ) ;
422426
423427 const onLaunchFrameButtonPressRef = useFreshRef ( onLaunchFrameButtonPressed ) ;
0 commit comments