Skip to content

Commit

Permalink
fix(core): should check if undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
triniwiz committed Mar 24, 2022
1 parent cc75b3a commit 92cffcf
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/mlkit-core/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const DetectorType_Pose = lazy(() => io.github.triniwiz.fancycamera.DetectorType
const DetectorType_Text = lazy(() => io.github.triniwiz.fancycamera.DetectorType.Text);
const DetectorType_Selfie = lazy(() => (io as any).github.triniwiz.fancycamera.DetectorType.Selfie);

const BARCODE_SCANNER_SUPPORTED = lazy(() => typeof io.github.triniwiz.fancycamera?.barcodescanning?.BarcodeScanner);
const TEXT_RECOGNITION_SUPPORTED = lazy(() => typeof io.github.triniwiz.fancycamera?.textrecognition?.TextRecognition);
const FACE_DETECTION_SUPPORTED = lazy(() => typeof io.github.triniwiz.fancycamera?.facedetection?.FaceDetection);
const IMAGE_LABELING_SUPPORTED = lazy(() => typeof io.github.triniwiz.fancycamera?.imagelabeling?.ImageLabeling);
const OBJECT_DETECTION_SUPPORTED = lazy(() => typeof io.github.triniwiz.fancycamera?.objectdetection?.ObjectDetection);
const POSE_DETECTION_SUPPORTED = lazy(() => typeof io.github.triniwiz.fancycamera?.posedetection?.PoseDetection);
const BARCODE_SCANNER_SUPPORTED = lazy(() => typeof io.github.triniwiz.fancycamera?.barcodescanning?.BarcodeScanner !== 'undefined');
const TEXT_RECOGNITION_SUPPORTED = lazy(() => typeof io.github.triniwiz.fancycamera?.textrecognition?.TextRecognition !== 'undefined');
const FACE_DETECTION_SUPPORTED = lazy(() => typeof io.github.triniwiz.fancycamera?.facedetection?.FaceDetection !== 'undefined');
const IMAGE_LABELING_SUPPORTED = lazy(() => typeof io.github.triniwiz.fancycamera?.imagelabeling?.ImageLabeling !== 'undefined');
const OBJECT_DETECTION_SUPPORTED = lazy(() => typeof io.github.triniwiz.fancycamera?.objectdetection?.ObjectDetection !== 'undefined');
const POSE_DETECTION_SUPPORTED = lazy(() => typeof io.github.triniwiz.fancycamera?.posedetection?.PoseDetection !== 'undefined');

const TORCH_MODE_ON = lazy(() => io.github.triniwiz.fancycamera.CameraFlashMode.TORCH);
const TORCH_MODE_OFF = lazy(() => io.github.triniwiz.fancycamera.CameraFlashMode.OFF);
Expand Down Expand Up @@ -392,7 +392,7 @@ export class MLKitView extends MLKitViewBase {
}

[faceDetectionTrackingEnabledProperty.setNative](value) {
if (!FACE_DETECTION_SUPPORTED) {
if (!FACE_DETECTION_SUPPORTED()) {
return;
}
if (!this.#faceDetectionOptions) {
Expand All @@ -405,7 +405,7 @@ export class MLKitView extends MLKitViewBase {
}

[faceDetectionMinFaceSizeProperty.setNative](value) {
if (!FACE_DETECTION_SUPPORTED) {
if (!FACE_DETECTION_SUPPORTED()) {
return;
}

Expand All @@ -418,7 +418,7 @@ export class MLKitView extends MLKitViewBase {
}

[faceDetectionPerformanceModeProperty.setNative](value) {
if (!FACE_DETECTION_SUPPORTED) {
if (!FACE_DETECTION_SUPPORTED()) {
return;
}

Expand Down Expand Up @@ -456,7 +456,7 @@ export class MLKitView extends MLKitViewBase {
}

[objectDetectionMultipleProperty.setNative](value) {
if (!OBJECT_DETECTION_SUPPORTED) {
if (!OBJECT_DETECTION_SUPPORTED()) {
return;
}

Expand Down

0 comments on commit 92cffcf

Please sign in to comment.