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: wc params for argent mobile #118

Merged
merged 4 commits into from
Aug 6, 2024
Merged

fix: wc params for argent mobile #118

merged 4 commits into from
Aug 6, 2024

Conversation

bluecco
Copy link
Contributor

@bluecco bluecco commented Jul 29, 2024

Issue / feature description

Quick description of the issue or the feature that is implemented in the pr ie: add new transitions between screens

Changes

quick list regarding the related changes within the pr

ie:

  • add new connector
  • fix injected connector
  • ...

Checklist

  • Rebased to the last commit of the target branch (or merged)
  • Code self-reviewed
  • Code self-tested
  • Tests updated (if needed)
  • All tests are passing locally

Please keep your pull request as small as possible. If you need to make multiple changes, please create separate pull requests for each change. Create a draft pull request if you need early feedback. This will mark the pull request as a work in progress and prevent it from being reviewed or merged until you are ready.

Please move drafts to the ready for review (regular PR) when you are ready to start the review process and other developers will pick it up from there.

Copy link

@mluisbrown mluisbrown left a comment

Choose a reason for hiding this comment

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

Is there any more context to this change? What is the problem that it is fixing?

@bluecco
Copy link
Contributor Author

bluecco commented Jul 29, 2024

@mluisbrown part of the related ticket in jira:

The link under QR could shown follow this schema https://www.argent.xyz/app/wc?uri=${encodedWcUri}&href=${href}&device=mobile

and this encoding was required by android team

})

) */
const desktopWcParam = encodeURIComponent(wcParam)

Choose a reason for hiding this comment

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

I cannot properly review it without the argent login changes, but that doesn't look correct. it's basically encodeURIComponent(encodeURIComponent(wcUri)) which doesn't make much sense.

I the commented out code it was necessary because desktopWcParam was an actual link

Copy link
Contributor Author

@bluecco bluecco Jul 30, 2024

Choose a reason for hiding this comment

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

@kamilargent ok, I probably misunderstood last time then

so, in this case, the following should be enough:

const wcParam = encodeURIComponent(wcUri)

this.showModal({
      desktop: `${this.bridgeUrl}?wc=${wcParam}&href=${href}&device=desktop`,
      ios: `${this.mobileUrl}app/wc?uri=${wcParam}&href=${href}&device=mobile`,
      android: `${this.mobileUrl}app/wc?uri=${wcParam}&href=${href}&device=mobile`,
    })

or we need to revert the commented code

 // KEEPING IN CASE NEEDS TO BE REVERTED
    const desktopWcParam = encodeURIComponent(
      `${this.mobileUrl}app/wc?uri=${wcParam}`,
    this.showModal({
      desktop: `${this.bridgeUrl}?wc=${desktopWcParam}&device=desktop`,
      ios: `${this.mobileUrl}app/wc?uri=${wcParam}&href=${href}&device=mobile`,
      android: `${this.mobileUrl}app/wc?uri=${wcParam}&href=${href}&device=mobile`,
    })

Choose a reason for hiding this comment

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

Everything depends on how you treat the wc param on the argent login side, when creating the QR code.

  1. If it's just getting encoded into the QR code, then, the previous code should be used (although new config.mobileUrl will have to be used as we need here https;//www.argent.xyz/ link instead of argent:// for desktop flow)
  2. If it's just getting the wc param end creates a new qr link, then we are ok with just const wcParam = encodeURIComponent(wcUri)
const wcParam = getQueryParam(link, "wc")
const href = getQueryParam(link, "href")

const qrCode = "https://www.argent.xyz/app/wc?uri=${wcParam}&href=${href}&device=desktop"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok @kamilargent
I think #2 is ok since the url creation is managed in argent-login

// argent-login code
 <FirstConnection
            qrCodeData={`https://www.argent.xyz/app/wc?uri=${walletConnectUrl}`}
          />

Choose a reason for hiding this comment

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

👍 as long as the walletConnectUrl is the encoded version of the wcUri we should be good

@bluecco bluecco merged commit b3a413f into develop Aug 6, 2024
1 check passed
@bluecco bluecco deleted the SK-9 branch August 6, 2024 13:05
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.

4 participants