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 NWC support detection #845

Merged
merged 2 commits into from
Feb 17, 2024
Merged

Fix NWC support detection #845

merged 2 commits into from
Feb 17, 2024

Conversation

ekzyis
Copy link
Member

@ekzyis ekzyis commented Feb 17, 2024

It worked with Mutiny because Mutiny only supports pay_invoice so the resulting array only contained a single element with value pay_invoice.

With wallets that supported multiple methods, the single element no longer matched pay_invoice.

2024-02-17.05-30-13.mp4

I think that's what every stacker encountered with red indicators but no error message since there is indeed no toast if pay_invoice support was not detected.

So I believe this fixes #821. I think the errors in the console are unrelated to NWC and that they are just "CSP WTF reports".

@ekzyis ekzyis added the bug label Feb 17, 2024
@sudocarlos
Copy link

Woot. Lfg

@huumn huumn merged commit 81ab960 into master Feb 17, 2024
1 check passed
@benthecarman
Copy link
Contributor

This did not fix for me when using https://github.com/benthecarman/nostr-wallet-connect-lnd

It seems you are separating by comma, but the nip defines it as space separated

@sudocarlos
Copy link

So Alby implemented it wrong. Could just parse with split(' ') after parsing with split(,) and then both would work, right? Go easy on me - am a noob.

@benthecarman
Copy link
Contributor

Have a fix for alby: getAlby/nostr-wallet-connect#247

@ekzyis ekzyis deleted the 821-nwc-unsafe-eval branch February 18, 2024 19:20
@ekzyis
Copy link
Member Author

ekzyis commented Feb 18, 2024

Could just parse with split(' ') after parsing with split(,) and then both would work, right?

Yes that's kind of what ben did in #855.

But you can't do it exactly like you described because split returns an array and you can't split an array:

> "foo,bar".split(",")
[ 'foo', 'bar' ]
> "foo,bar".split(",").split(" ")
Uncaught TypeError: "foo,bar".split(...).split is not a function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unsafe-eval used for NWC in Arc browser
4 participants