change android logic

This commit is contained in:
Shalom Yerushalmy 2018-12-17 10:36:13 +02:00
parent 3c6e4c54fc
commit a20814dd9e
1 changed files with 1 additions and 10 deletions

View File

@ -8,7 +8,6 @@ import {
const NativeCamera = requireNativeComponent('CameraView', null);
const NativeCameraModule = NativeModules.CameraModule;
const TorchModule = NativeModules.CKTorch;
export default class CameraKitCamera extends React.Component {
@ -45,15 +44,7 @@ export default class CameraKitCamera extends React.Component {
}
async setTorchMode(newState) {
let done;
let failure;
const result = new Promise((resolve, reject) => {
done = resolve;
failure = reject;
});
await TorchModule.switchState(newState, done, failure);
return result;
return await NativeCameraModule.setTorchMode(newState);
}
static async checkDeviceCameraAuthorizationStatus() {