Skip to content

Commit

Permalink
fix: apply changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
WoLewicki committed Aug 9, 2024
1 parent b8417d8 commit 79dfe34
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions android/src/main/java/com/rncamerakit/CKCameraManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions src/Camera.android.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

This comment has been minimized.

Copy link
@j-piasecki

j-piasecki Aug 12, 2024

Is ?? null needed inside findNodeHandle?

},
requestDeviceCameraAuthorization: () => {
throw new Error('Not implemented');
Expand Down
3 changes: 1 addition & 2 deletions src/Camera.ios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

This comment has been minimized.

Copy link
@j-piasecki

j-piasecki Aug 12, 2024

Same

},
requestDeviceCameraAuthorization: async () => {
return await NativeCameraKitModule.checkDeviceCameraAuthorizationStatus();
Expand Down

0 comments on commit 79dfe34

Please sign in to comment.