Files
akkounts/app/components/settings/nostr_edit_profile_component.rb
T
raucao a9045fa413 WIP: Improve Nostr user metadata fetching
Use a multi-step process, caching results in between, while informing
the user about the current steps/progress
2026-08-11 18:16:58 -06:00

18 lines
487 B
Ruby

# frozen_string_literal: true
module Settings
class NostrEditProfileComponent < ViewComponent::Base
def initialize(user:, profile_event:)
@user = user
@profile_event = profile_event
@profile = {}
@display_name = nil
if profile_event.present? && profile_event["content"].present?
@profile = JSON.parse(profile_event["content"]) rescue {}
@display_name = @profile["display_name"] || @profile["displayName"]
end
end
end
end