diff --git a/app/controllers/services/lightning_controller.rb b/app/controllers/services/lightning_controller.rb index 94aed24..1253ab0 100644 --- a/app/controllers/services/lightning_controller.rb +++ b/app/controllers/services/lightning_controller.rb @@ -8,8 +8,7 @@ class Services::LightningController < ApplicationController before_action :fetch_balance def index - @wallet_url = "lndhub://#{current_user.ln_account}:#{current_user.ln_password}@#{ENV['LNDHUB_PUBLIC_URL']}" - initialize_lndhub_qr_code + @wallet_setup_url = "lndhub://#{current_user.ln_account}:#{current_user.ln_password}@#{ENV['LNDHUB_PUBLIC_URL']}" end def transactions @@ -56,20 +55,6 @@ class Services::LightningController < ApplicationController private - def initialize_lndhub_qr_code - qr_code = RQRCode::QRCode.new(@wallet_url) - @lndhub_qr_svg = qr_code.as_svg( - color: "000", - shape_rendering: "crispEdges", - module_size: 6, - standalone: true, - use_path: true, - svg_attributes: { - class: 'inline-block' - } - ) - end - def authenticate_with_lndhub(options={}) if session[:ln_auth_token].present? && !options[:force_reauth] @ln_auth_token = session[:ln_auth_token] diff --git a/app/views/services/lightning/index.html.erb b/app/views/services/lightning/index.html.erb index 6d18379..58a7c12 100644 --- a/app/views/services/lightning/index.html.erb +++ b/app/views/services/lightning/index.html.erb @@ -29,7 +29,7 @@
-You can connect various wallet apps to your Kosmos account. This allows @@ -40,19 +40,16 @@
+ value="<%= @wallet_setup_url %>" data-clipboard-target="source" /> or - - -
-- <%= raw @lndhub_qr_svg %> +
+ <%= render QrCodeModalComponent.new(qr_content: @wallet_setup_url) %>