diff --git a/packages/legacy/core/App/screens/Scan.tsx b/packages/legacy/core/App/screens/Scan.tsx index a04b04eca..d2866f87a 100644 --- a/packages/legacy/core/App/screens/Scan.tsx +++ b/packages/legacy/core/App/screens/Scan.tsx @@ -35,19 +35,18 @@ const Scan: React.FC = ({ navigation, route }) => { const handleInvitation = async (value: string): Promise => { try { - const connectionRecord = await connectFromInvitation(value, agent) - if (connectionRecord?.connectionRecord?.id) { + const receivedInvitation = await connectFromInvitation(value, agent) + if (receivedInvitation?.connectionRecord?.id) { // not connectionless navigation.getParent()?.navigate(Stacks.ConnectionStack, { screen: Screens.Connection, - params: { connectionId: connectionRecord.connectionRecord.id }, + params: { connectionId: receivedInvitation.connectionRecord.id }, }) } else { //connectionless - //const invitation = await agent?.oob.parseInvitation(value) navigation.navigate(Stacks.ConnectionStack as any, { screen: Screens.Connection, - params: { threadId: connectionRecord?.outOfBandRecord.outOfBandInvitation.threadId }, + params: { threadId: receivedInvitation?.outOfBandRecord.outOfBandInvitation.threadId }, }) } } catch (err: unknown) {