Improve nostr settings, fix allowsNostr property name
This commit is contained in:
@@ -18,8 +18,8 @@ class LnurlpayController < ApplicationController
|
||||
commentAllowed: MAX_COMMENT_CHARS
|
||||
}
|
||||
|
||||
if Setting.nostr_enabled? && Setting.nostr_private_key.present?
|
||||
res[:allows_nostr] = true
|
||||
if Setting.nostr_enabled?
|
||||
res[:allowsNostr] = true
|
||||
res[:nostrPubkey] = Setting.nostr_public_key
|
||||
end
|
||||
|
||||
@@ -52,7 +52,7 @@ class LnurlpayController < ApplicationController
|
||||
return
|
||||
end
|
||||
|
||||
if params[:nostr].present?# TODO && Setting.nostr_enabled?
|
||||
if params[:nostr].present? && Setting.nostr_enabled?
|
||||
handle_zap_request amount, params[:nostr], params[:lnurl]
|
||||
else
|
||||
handle_pay_request address, amount, comment
|
||||
|
||||
@@ -160,7 +160,8 @@ class Setting < RailsSettings::Base
|
||||
# Nostr
|
||||
#
|
||||
|
||||
field :nostr_enabled, type: :boolean, default: false
|
||||
field :nostr_enabled, type: :boolean,
|
||||
default: ENV["NOSTR_PRIVATE_KEY"].present?
|
||||
|
||||
field :nostr_private_key, type: :string,
|
||||
default: ENV["NOSTR_PRIVATE_KEY"].presence
|
||||
|
||||
Reference in New Issue
Block a user