Offer LNURL QR code for download on Lightning info page #135

Merged
raucao merged 5 commits from feature/lightning_donation_qr_codes into master 2023-06-20 16:44:59 +00:00
Owner

Add a section for downloading lnurl-pay QR codes to print out or publish in any other way. Options for SVG and PNG.

closes #134

Add a section for downloading lnurl-pay QR codes to print out or publish in any other way. Options for SVG and PNG. closes #134
raucao added the
kredits-2
feature
labels 2023-06-12 16:21:24 +00:00
raucao added 3 commits 2023-06-12 16:21:24 +00:00
Add a copy button for the Lightning address
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
07fe8dba71
Same as on profile settings page.
slvrbckt requested review from slvrbckt 2023-06-12 16:47:56 +00:00
slvrbckt approved these changes 2023-06-12 20:38:54 +00:00
slvrbckt left a comment
Owner

I tried to get akkounts running on my local computer but I kept running into issues, I fixed a few things but then ran into more. It looks like part of the database settings table wasn't properly initialized and/or something else.

Just looking at the code, it seems alright to me. Would love to be able to try this out in production!

I tried to get `akkounts` running on my local computer but I kept running into issues, I fixed a few things but then ran into more. It looks like part of the database `settings` table wasn't properly initialized and/or something else. Just looking at the code, it seems alright to me. Would love to be able to try this out in production!
bumi reviewed 2023-06-13 09:21:01 +00:00
@ -11,0 +21,4 @@
lnurlp_bech32 = Lnurl.new(lnurlp_url).to_bech32
qr_code = RQRCode::QRCode.new("lightning:" + lnurlp_bech32)
if params[:format] == "svg"
Owner

why don't you use respond_to here?

why don't you use `respond_to` here?
Author
Owner

Good question. Should've done so to begin with. Refactored and pushed.

Good question. Should've done so to begin with. Refactored and pushed.
Owner

I'd move the logic out of this block and only have

lnurlp_url = "https://kosmos.org/.well-known/lnurlp/#{current_user.cn}"
lnurlp_bech32 = Lnurl.new(lnurlp_url).to_bech32
qr_code = RQRCode::QRCode.new("lightning:" + lnurlp_bech32)
      
respond_to do |format|
  format.svg ...
  format.png ...
end
I'd move the logic out of this block and only have ``` lnurlp_url = "https://kosmos.org/.well-known/lnurlp/#{current_user.cn}" lnurlp_bech32 = Lnurl.new(lnurlp_url).to_bech32 qr_code = RQRCode::QRCode.new("lightning:" + lnurlp_bech32) respond_to do |format| format.svg ... format.png ... end ```
raucao marked this conversation as resolved
@ -11,0 +35,4 @@
send_data(
qr_svg,
filename: "bitcoin-lightning-#{current_user.address}.svg",
type: "image/svg+xml"
Owner

does this need a disposition attribute? 🤔

does this need a `disposition` attribute? 🤔
Author
Owner

Disposition should default to attachment, i.e. download. It works exactly as intended in FF, maybe you could test manually in another browser?

Disposition should default to attachment, i.e. download. It works exactly as intended in FF, maybe you could test manually in another browser?
raucao marked this conversation as resolved
raucao added 1 commit 2023-06-13 10:31:08 +00:00
Use respond_to for request formats
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
332ad757a5
raucao requested review from bumi 2023-06-13 10:32:28 +00:00
raucao added the
release
minor
label 2023-06-16 13:07:08 +00:00
raucao added 1 commit 2023-06-18 13:51:48 +00:00
Merge branch 'master' into feature/lightning_donation_qr_codes
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
89c67f3617
bumi approved these changes 2023-06-20 15:46:22 +00:00
raucao added 1 commit 2023-06-20 16:18:32 +00:00
Resolve review comment
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Release Drafter / Update release notes draft (pull_request) Successful in 3s
d922e7f869
raucao merged commit 7987e92723 into master 2023-06-20 16:44:59 +00:00
raucao deleted branch feature/lightning_donation_qr_codes 2023-06-20 16:44:59 +00:00
Sign in to join this conversation.
No description provided.