Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera rebrand feature flash #1826

Merged
merged 4 commits into from
Jul 19, 2022
Merged

Camera rebrand feature flash #1826

merged 4 commits into from
Jul 19, 2022

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.

3 participants