Skip to content

Commit

Permalink
refactored variable name
Browse files Browse the repository at this point in the history
Signed-off-by: Clécio Varjão <[email protected]>
  • Loading branch information
cvarjao committed Sep 21, 2023
1 parent 264d7db commit 75c4c3c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/legacy/core/App/screens/Scan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,18 @@ const Scan: React.FC<ScanProps> = ({ navigation, route }) => {

const handleInvitation = async (value: string): Promise<void> => {
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) {
Expand Down

0 comments on commit 75c4c3c

Please sign in to comment.