Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ function captureId() {

// 5.- Process the ID
async function processId() {
const results = await incode.processId({
token: incodeSession.token,
});
console.log("processId results", results);
captureSelfie();
return incode.processId({ token: incodeSession.token })
.then(() => {
captureSelfie();
})
.catch((error) => {
showError(error);
});
Comment on lines +75 to +81
Copy link

Copilot AI Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The refactoring from async/await to Promise chaining reduces readability without clear benefit. The async/await pattern was more readable and the original code was missing error handling, which could have been added with a try/catch block instead.

Suggested change
return incode.processId({ token: incodeSession.token })
.then(() => {
captureSelfie();
})
.catch((error) => {
showError(error);
});
try {
await incode.processId({ token: incodeSession.token });
captureSelfie();
} catch (error) {
showError(error);
}

Copilot uses AI. Check for mistakes.
}

// 6.- Capture the selfie
Expand Down