I had a bit of a hard time wrapping my head around this one (also `#to_h` is throwing errors).  I'll leave this up to you, because it's working/tested code, but perhaps it's a bit more readable as something along the lines of

    if params[:f]
      blacklight_config.facet_fields.values.map do |facet|
        facet.label if params[:f][facet.field].present?
      end.compact.join(', ')
    end