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

Fix: share button sometimes not working after first share #847

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

cimigree
Copy link
Contributor

@cimigree cimigree commented Nov 14, 2024

closes #834

Description

  • I came across this when developing Audio
  • The urls for the attachments only work once for converting into readable files.
  • So, in the Share button, after the first Share was pressed, the network call for converting the url to a base64 image was failing and no amount of time waiting would fix that.
  • This PR uses the getUrl query to fetch a new url for each attachment every time the share button is pressed because the hook can't be used in regular functions or conditionally.
  • We can't set the base64 in state because technically opening the share menu is putting the app in the background and state would clear out when share is pressed (something else I came across in the Audio development)
  • This is working well, so hoping it works for you too!
  • I also added failOnCancel: false so there is no error thrown if a user decides not to share the observation

To test

  1. Create an observation or observations with attachments and some without
  2. Share them as many times as you want without leaving the observation screen.
  3. I can't test on What's App so please test on What's App for me

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.

Share button /Inconsistent
1 participant