Skip to content

Conversation

@sultanmyrza
Copy link
Contributor

No description provided.

async enableTorch(enable: boolean): Promise<void> {
if (this.isNativePlatform) {
return await PreviewCamera.enableTorch({ enable });
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sultanmyrza Should we handle the "else" case?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bafu we do not support web at this point so I don't think we need else block.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type is Promise, and the function will return implicitly in the "else" case.

In camera.enableTorch (L183), it just awaits the service.enableTorch, so functionality-wise it should work. It might increase future readability for the other collaborators to indicate the return value in the "else" case.

@bafu bafu merged commit edc1503 into develop Jul 19, 2022
@bafu bafu deleted the camera-rebrand-feature-flash branch July 19, 2022 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants