Use a multi-step process, caching results in between, while informing the user about the current steps/progress
18 lines
487 B
Ruby
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
|