diff --git a/demos/test-app/src/index.tsx b/demos/test-app/src/index.tsx index ddd46842c7..d16f4de9cb 100644 --- a/demos/test-app/src/index.tsx +++ b/demos/test-app/src/index.tsx @@ -415,6 +415,16 @@ function handleFlowReady(evnt: MessageEvent) { } function handleFlowFinished(evnt: MessageEvent) { + if (latestOpts === undefined) { + // no onlight requests, so we don't expect a response. + return; + } + + if (evnt.data?.id !== latestOpts.flowId) { + // If this is not a response to a flow we started, ignore it + return; + } + try { // Make the presentation presentable const verifiablePresentation = evnt.data?.result?.verifiablePresentation;