ton-connect / sdk

SDK for TON Connect 2.0 — a comprehensive communication protocol between wallets and apps in TON ecosystem
Apache License 2.0
319 stars 87 forks source link

[UI]: <= @2.0.5 - Issue with handling Ton Connect QR codes #184

Open Totemancer opened 4 months ago

Totemancer commented 4 months ago

Describe the bug

It doesn’t generate a proper QR code if we decide to scan the QR without opening the Tonkeeper website.

Expected behavior

Do not show the QR code without clicking on the link, or create a new QR code anyway, even if it is canceled.

openlink1

Current behavior

Currently, even if canceled, we have a ‘Show QR Code’ button available, which has no created tunnels or is bugged. It is suggested to call the URL in the background or not show any QR code without confirming that the user clicked on the link.

tonkeeper1 showqr1

Steps to Reproduce

Steps to Reproduce the Issue:

  1. Open Telegram on desktop.
  2. Click “Connect.”
  3. Click “Tonkeeper.”
  4. Click “Cancel.”
  5. Click “Show QR Code.”
  6. Scan with phone.
  7. Error occurs.

How it Works:

  1. Open Telegram on desktop.
  2. Click “Connect.”
  3. Click “Tonkeeper.”
  4. Click “Open.”
  5. Close down.
  6. Click “Show QR Code.”
  7. Scan with phone.
  8. Success.

Suggested:

  1. Open Telegram on desktop.
  2. Click “Connect.”
  3. Click “Tonkeeper.”
  4. Show QR Code.
  5. Scan with phone.
  6. Success.

Environment

Windows, MacOS, Linux - Telegram Desktop (All versions)

Additional context

No response

Totemancer commented 4 months ago

Additional Information and Bug Report: It's still related to this case.

On a traditional browser, it works as expected, showing the QR code ready to scan and offering a "Desktop" button because it detects the Tonkeeper Desktop client. These functions are not available on computers running macOS from the Telegram Mini App. It defaults to mobile always.

Please implement platform detection inside mobile apps.

Suggesting these solutions to handle the current problem:

Thank you in advance!

Desktop - Browser (Chrome/Safari) UI:

desktop_detection

Desktop - Mini App UI:

miniapp