[fix]Remove duplicate code

This commit is contained in:
Jimmy 2021-04-22 01:24:14 +08:00 committed by CactusPuppy
parent 375f53cdf6
commit a2d775e36d
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82
3 changed files with 12 additions and 24 deletions

View file

@ -98,6 +98,18 @@ module ConferenceHelper
events_schedules
end
def load_happening_now
events_schedules_list = get_happening_now_events_schedules(@conference)
@is_happening_next = false
if events_schedules_list.empty?
events_schedules_list = get_happening_next_events_schedules(@conference)
@is_happening_next = true
end
@events_schedules_limit = EVENTS_PER_PAGE
@events_schedules_length = events_schedules_list.length
@pagy, @events_schedules = pagy_array(events_schedules_list, items: @events_schedules_limit, link_extra: 'data-remote="true"')
end
private
def filter_events_schedules(conference, filter)