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): Prevent share if sharing in progress #489

Merged
merged 4 commits into from Jun 24, 2021
Merged

Conversation

jcesarmobile
Copy link
Member

If you call share twice in a row it causes issues, on android two sheets appear but both return the result of the first one, on iOS the second one is not presented and the promise never resolves nor rejects.

This PR detects if a share is in progress and prevent it rejecting with an error-

closes #323

@Ionitron Ionitron added this to Needs review 🤔 in Capacitor Engineering ⚡️ Jun 18, 2021
@jcesarmobile jcesarmobile merged commit 3479783 into main Jun 24, 2021
@jcesarmobile jcesarmobile deleted the multiple-shares branch June 24, 2021 17:38
Capacitor Engineering ⚡️ automation moved this from Needs review 🤔 to Done 🎉 Jun 24, 2021
@qliqdev
Copy link

qliqdev commented Jan 16, 2024

While inapp browser is opened share is not working

throwing

Can't share while sharing is in progress, event if Share.canShare() returns {value: true}

if self?.bridge?.viewController?.presentedViewController != nil {
call.reject("Can't share while sharing is in progress")
return
}

is this expression right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

bug: Share component can crash app if invoked twice in a row
4 participants