Skip to content

Commit

Permalink
Fix nullish operator type error
Browse files Browse the repository at this point in the history
  • Loading branch information
eucool committed Mar 31, 2024
1 parent 2de7096 commit f85a3a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ function IOURequestStepScan({

const camera = useRef<Camera>(null);
const [flash, setFlash] = useState(false);
const [cameraPermissionStatus, setCameraPermissionStatus] = useState<string | null>(null);
const [cameraPermissionStatus, setCameraPermissionStatus] = useState<string | null>(null);
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const hasFlash = device?.hasFlash || false;

const {translate} = useLocalize();
Expand Down
6 changes: 4 additions & 2 deletions src/pages/iou/request/step/IOURequestStepScan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ function IOURequestStepScan({
if (!Browser.isMobile() || !isTabActive) {
return;
}
navigator.permissions
.query({name: 'camera'})
navigator.permissions.query({
// @ts-expect-error camera does exist in PermissionName
name: 'camera'
})
.then((permissionState) => {
setCameraPermissionState(permissionState.state);
if (permissionState.state === 'granted') {
Expand Down

0 comments on commit f85a3a9

Please sign in to comment.