Skip to content

Commit

Permalink
chore[Op#40437]: remove redundant reactions single update, rely on fu…
Browse files Browse the repository at this point in the history
…ll component refresh
  • Loading branch information
akabiru committed Oct 25, 2024
1 parent e6aed59 commit fb419dd
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions app/controllers/work_packages/activities_tab_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ def handle_other_filters_on_create(call)
def perform_update_streams_from_last_update_timestamp
if params[:last_update_timestamp].present? && (last_updated_at = Time.zone.parse(params[:last_update_timestamp]))
generate_time_based_update_streams(last_updated_at)
generate_time_based_reaction_update_streams(last_updated_at)
else
@turbo_status = :bad_request
end
Expand Down Expand Up @@ -330,20 +329,6 @@ def generate_time_based_update_streams(last_update_timestamp)
end
end

def generate_time_based_reaction_update_streams(last_updated_at)
# Current limitation: Only shows added reactions, not removed ones
Journal.grouped_work_package_journals_emoji_reactions(
@work_package, last_updated_at:
).each do |journal_id, grouped_emoji_reactions|
update_via_turbo_stream(
component: WorkPackages::ActivitiesTab::Journals::ItemComponent::Reactions.new(
journal: @work_package.journals.find(journal_id),
grouped_emoji_reactions:
)
)
end
end

def rerender_updated_journals(journals, last_update_timestamp, grouped_emoji_reactions)
journals.where("updated_at > ?", last_update_timestamp).find_each do |journal|
update_item_show_component(journal:, grouped_emoji_reactions: grouped_emoji_reactions.fetch(journal.id, {}))
Expand Down

0 comments on commit fb419dd

Please sign in to comment.