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: samsungpay script mount condition correction #897

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

Conversation

aritro2002
Copy link
Contributor

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

The Samsung Pay script should be mounted only when Samsung Pay is present and the script is not already mounted. Previously, we only checked whether it was mounted.

How did you test it?

I tested by running it in demo store.
Screenshot 2025-02-12 at 4 49 13 PM

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

Copy link

Review changes with  SemanticDiff

@aritro2002 aritro2002 added the Ready for Review PR with label Ready for Review should only be reviewed. label Feb 12, 2025
@aritro2002 aritro2002 linked an issue Feb 12, 2025 that may be closed by this pull request

mountSamsungPayScript(samsungPayPresent)
Copy link
Contributor

Choose a reason for hiding this comment

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

if samsung pay is present then only call this function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I call mountSamsungPayScript inside the if block when Samsung Pay is present, I will need to duplicate the same logic in both the if and else blocks. Additionally, since a similar implementation would be required for Google Pay, it would lead to even more repeated code.

To keep the implementation clean and avoid redundancy, I believe the current approach is more maintainable. Let me know if you have any suggestions on structuring it better without introducing duplication.

Screenshot 2025-02-13 at 11 21 06 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for Review PR with label Ready for Review should only be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

samsungpay script mount condition correction
2 participants