about summary refs log tree commit diff
path: root/app/controllers/api/v1
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-19 11:06:06 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-19 11:06:06 +0100
commit98560b232acc9d16d3515133721266f170e31ae6 (patch)
tree16c6be6d3db67fd9dffe8474cd2646d224d3307d /app/controllers/api/v1
parent9b0941182f5277069b85ef1601832e28ebd1ba43 (diff)
Don't show loading bar when re-loading already loaded status. Don't even try to fetch ancestors from DB when in_reply_to_id is nil
Diffstat (limited to 'app/controllers/api/v1')
-rw-r--r--app/controllers/api/v1/statuses_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb
index f033ef6c1..c661d81c1 100644
--- a/app/controllers/api/v1/statuses_controller.rb
+++ b/app/controllers/api/v1/statuses_controller.rb
@@ -14,7 +14,7 @@ class Api::V1::StatusesController < ApiController
   end
 
   def context
-    @context = OpenStruct.new(ancestors: @status.ancestors(current_account), descendants: @status.descendants(current_account))
+    @context = OpenStruct.new(ancestors: @status.in_reply_to_id.nil? ? [] : @status.ancestors(current_account), descendants: @status.descendants(current_account))
     statuses = [@status] + @context[:ancestors] + @context[:descendants]
 
     set_maps(statuses)