Fix infinite scroll on search... some kind of weird thing with rails responding with json even when request.format is html, with a mime type of html
This commit is contained in:
parent
f60ce932b1
commit
3a18044821
1 changed files with 13 additions and 2 deletions
|
|
@ -30,7 +30,18 @@ class PeopleController < ApplicationController
|
||||||
render :json => @people
|
render :json => @people
|
||||||
end
|
end
|
||||||
|
|
||||||
format.all do
|
format.html do
|
||||||
|
#only do it if it is an email address
|
||||||
|
if params[:q].try(:match, Devise.email_regexp)
|
||||||
|
people = Person.where(:diaspora_handle => params[:q])
|
||||||
|
webfinger(params[:q]) if people.empty?
|
||||||
|
else
|
||||||
|
people = Person.search(params[:q], current_user)
|
||||||
|
end
|
||||||
|
@people = people.paginate( :page => params[:page], :per_page => 15)
|
||||||
|
@hashes = hashes_for_people(@people, @aspects)
|
||||||
|
end
|
||||||
|
format.mobile do
|
||||||
#only do it if it is an email address
|
#only do it if it is an email address
|
||||||
if params[:q].try(:match, Devise.email_regexp)
|
if params[:q].try(:match, Devise.email_regexp)
|
||||||
people = Person.where(:diaspora_handle => params[:q])
|
people = Person.where(:diaspora_handle => params[:q])
|
||||||
|
|
@ -68,7 +79,7 @@ class PeopleController < ApplicationController
|
||||||
@person = Person.find_from_id_or_username(params)
|
@person = Person.find_from_id_or_username(params)
|
||||||
|
|
||||||
if remote_profile_with_no_user_session?
|
if remote_profile_with_no_user_session?
|
||||||
raise ActiveRecord::RecordNotFound
|
raise ActiveRecord::RecordNotFound
|
||||||
end
|
end
|
||||||
|
|
||||||
@post_type = :all
|
@post_type = :all
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue