Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby
665 B
Raw Blame
# Broadcasts Turbo Stream updates when a CoinStats sync completes.
# Updates account views and notifies the family of sync completion.
class CoinstatsItem::SyncCompleteEvent
  attr_reader :coinstats_item

  # @param coinstats_item [CoinstatsItem] The item that completed syncing
  def initialize(coinstats_item)
    @coinstats_item = coinstats_item
  end

  # Broadcasts sync completion to update UI components.
  def broadcast
    # Update UI with latest account data
    coinstats_item.accounts.each do |account|
      account.broadcast_sync_complete
    end

    # Let family handle sync notifications
    coinstats_item.family.broadcast_sync_complete
  end
end