Skip to content

Commit

Permalink
const name change
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemorawski committed Oct 21, 2023
1 parent 710cee1 commit 9e87798
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/iou/ReceiptSelector/NavigationAwareCamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ function useTabNavigatorFocus({cameraTabIndex, isInTabNavigator}) {
// Wraps a camera that will only be active when the tab is focused or as soon as it starts to become focused.
const NavigationAwareCamera = React.forwardRef(({torchOn, onTorchAvailability, cameraTabIndex, isInTabNavigator, ...props}, ref) => {
const trackRef = useRef(null);
const showCamera = useTabNavigatorFocus({cameraTabIndex, isInTabNavigator});
const shouldShowCamera = useTabNavigatorFocus({
cameraTabIndex,
isInTabNavigator,
});

const handleOnUserMedia = (stream) => {
if (props.onUserMedia) {
Expand All @@ -97,7 +100,7 @@ const NavigationAwareCamera = React.forwardRef(({torchOn, onTorchAvailability, c
});
}, [torchOn]);

if (!showCamera) {
if (!shouldShowCamera) {
return null;
}
return (
Expand Down

0 comments on commit 9e87798

Please sign in to comment.