Skip to content

Commit

Permalink
Remove await & catch errors when logging before navigating to AR came…
Browse files Browse the repository at this point in the history
…ra result
  • Loading branch information
kvangork committed Jan 3, 2025
1 parent 3e4cede commit bee8d23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/Camera/ARCamera/ARCamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,19 @@ const ARCamera = ( ): Node => {
// this is also needed for ancestor screen, species nearby
const { image, errorCode } = await fetchImageLocationOrErrorCode( userImage, login );
const hasCoordinates = isNumber( image?.latitude ) && isNumber( image?.longitude );
await logToApi( {
logToApi( {
level: "info",
message: `hasCoordinates ${hasCoordinates}`,
context: "takePhoto",
errorType: errorCode?.toString() || "0"
} );
} ).catch( ( logError ) => logger.error( "logToApi failed:", logError ) );
const rankLevel = image?.predictions.sort( ( a, b ) => a.rank_level - b.rank_level )[0]?.rank_level || 100;
await logToApi( {
logToApi( {
level: "info",
message: `rankLevel ${rankLevel}`,
context: "takePhoto rankLevel",
errorType: errorCode?.toString() || "0"
} );
} ).catch( ( logError ) => logger.error( "logToApi failed:", logError ) );
logger.debug( "fetchImageLocationOrErrorCode resolved" );
image.errorCode = errorCode;
image.arCamera = true;
Expand Down

0 comments on commit bee8d23

Please sign in to comment.