Switched to the new cashtab-connect lib#526
Conversation
… maintained by us).
| */ | ||
| export const openCashtabPayment = async (bip21Url: string, fallbackUrl?: string): Promise<void> => { | ||
| try { | ||
| const isAvailable = await getCashtabProviderStatus(); |
There was a problem hiding this comment.
this approach -- checking status on button click -- is probably effective in most current contexts. However it would be wasteful for any application where multiple clicks are expected.
The cashtab provider status is not expected to change during a user's visit (and, even if it did --- e.g. if the user installs the cashtab extension --- a refresh is required for this to be detected).
Would be more robust and payments would be faster if this check were performed on page load. This would also allow you to conditionally render the button, i.e. show the user that it will open Cashtab or the mobile app or Electrum before a click.
|
Changes:
|
chedieck
left a comment
There was a problem hiding this comment.
Works well, just the same thing about too many redundant comments pollution
Klakurka
left a comment
There was a problem hiding this comment.
Some of the comments I do find useful but I removed the rest.

Related to #516
Description
This change standardizes how we interact with both the Cashtab extension and (fallback) website.
Test plan
Initiate payments with the Cashtab extension installed and not installed.