fix: apply changes from review

This commit is contained in:
Wojciech Lewicki 2024-08-09 09:37:14 +02:00
parent b8417d8c5e
commit 79dfe34189
No known key found for this signature in database
GPG Key ID: 51C26B36FE3B7920
3 changed files with 3 additions and 6 deletions

View File

@ -129,6 +129,7 @@ class CKCameraManager : SimpleViewManager<CKCamera>(), CKCameraManagerInterface<
view.setShutterPhotoSound(enabled);
}
// Methods only available on iOS
override fun setRatioOverlay(view: CKCamera?, value: String?) = Unit
override fun setRatioOverlayColor(view: CKCamera?, value: Int?) = Unit

View File

@ -10,10 +10,7 @@ const Camera = React.forwardRef<CameraApi, CameraProps>((props, ref) => {
React.useImperativeHandle(ref, () => ({
capture: async (options = {}) => {
// Because RN doesn't support return types for ViewManager methods
// we must use the general module and tell it what View it's supposed to be using
// @ts-ignore make TS happy
return await NativeCameraKitModule.capture(options, findNodeHandle(nativeRef.current ?? null));
return await NativeCameraKitModule.capture(options, findNodeHandle(nativeRef.current ?? null) ?? undefined);
},
requestDeviceCameraAuthorization: () => {
throw new Error('Not implemented');

View File

@ -13,8 +13,7 @@ const Camera = React.forwardRef<CameraApi, CameraProps>((props, ref) => {
React.useImperativeHandle(ref, () => ({
capture: async () => {
// @ts-ignore it was like this already
return await NativeCameraKitModule.capture({}, findNodeHandle(nativeRef.current ?? null));
return await NativeCameraKitModule.capture({}, findNodeHandle(nativeRef.current ?? null) ?? undefined);
},
requestDeviceCameraAuthorization: async () => {
return await NativeCameraKitModule.checkDeviceCameraAuthorizationStatus();