Skip to content

fix: correct inverted logic in makeExpertCall function #339

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

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

Conversation

navaneeth0041
Copy link
Contributor

Description

This pull request addresses a bug in the makeExpertCall function within the LocalExpert feature. The bug was caused by inverted conditional logic, which resulted in displaying an alert dialog instead of launching the phone dialer when users attempted to call an expert.

🛠️ Fix Summary:

  • Corrected the logic by checking await canLaunchUrl(phoneUri) instead of its negation.

  • Added a context.mounted check before attempting to show the alert dialog to prevent runtime issues.

  • Ensured consistent use of the existing showAlertDialog utility.

This fix improves the user experience by ensuring the phone dialer opens as expected when tapping the call icon.

Fixes #338

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Manually tested the fix
  • Verified that tapping the phone icon opens the phone dialer for valid tel: URIs
  • Verified that the alert dialog appears only when the dialer cannot be launched
  • Confirmed context.mounted check prevents widget lifecycle issues
WhatsApp.Video.2025-04-07.at.00.02.24.mp4

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

@navaneeth0041 navaneeth0041 requested a review from jddeep as a code owner April 6, 2025 18:35
@navaneeth0041
Copy link
Contributor Author

@AyaNady17 @mdmohsin7 Can u review this PR

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.

Fix inverted logic in makeExpertCall function causing phone dialer launch failure
1 participant