GaloyMoney / galoy-pay

A web application that can be used to send tips or payments to users
MIT License
22 stars 35 forks source link

Can't Print LNURL QR Code Twice #136

Open leesalminen opened 2 years ago

leesalminen commented 2 years ago

Testing out the latest PR that was merged with LNURL support and think I ran into an issue with printing QR codes.

OS Used: MacOS Monterrey 12.0.1 Browser Used: Safari 15.1 (17612.2.9.1.20)

Steps to reproduce:

1.) Navigate to /[user]/print 2.) Click blue "Use Web URL" button 3.) Click blue "Print QR code" button 4.) Cancel system print window 5.) Click blue "Use LNURL" button 6.) Click blue "Print QR Code" button 7.) Safari will prompt "This webpage is trying to print. Do you want to print this webpage?", click "Print" 8.) Print preview generates blank

I also tested this with Firefox 94.0.2 on the same OS and didn't encounter this issue. Also tested on iOS 15.1.1 with Safari and didn't encounter this issue, so it seems to be only affecting Safari Desktop.

This appears to be a known issue with the react-to-print library that this repo is using. See: https://github.com/gregnb/react-to-print/issues/397 . The posted workaround is kind of ugly, unsure if it would be worth it to implement in this repo.

MatthewHerbst commented 2 years ago

Hello, I'm the maintainer for react-to-print. Please note that this appears to be an upstream issue with Safari, and is not limited to react-to-print. Example: https://github.com/crabbly/Print.js/issues/528