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

Ai camera shutter button not tappable after first press #2848

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

angielt
Copy link
Collaborator

@angielt angielt commented Apr 9, 2025

based off of solution for #2833

@angielt angielt changed the title Ai camera shutter button tappable after first press Ai camera shutter button not tappable after first press Apr 9, 2025
@angielt angielt requested a review from albullington April 9, 2025 20:32
Copy link
Collaborator

@albullington albullington left a comment

Choose a reason for hiding this comment

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

I unfortunately can't test that this is working, since I haven't been able to tap more than once on the shutter button in the AICamera in the first place. But I still can't tap more than once in this branch, and I stuck with a code-related review.

@@ -59,7 +59,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's not change this in this PR.

};

const isDisabled = disabled || ( preventMultipleTaps && isProcessing );

return (
<Pressable
Copy link
Collaborator

Choose a reason for hiding this comment

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

Being a tiny bit forward thinking here, can we move this logic into a SharedComponent, maybe called PressableWithDebounce? I'm assuming a few things here:

  1. we'll want this logic on other buttons throughout the app (maybe even in the camera, on the gallery button for example)
  2. it would be nice to be able to quickly swap out a Pressable for a PressableWithDebounce in case we run into any timing issues with this (here or elsewhere)
  3. it's nicer to standardize the debounce time in a single location, rather than making TakePhoto responsible for receiving props and knowing how long to debounce

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.

2 participants