chore: Refactor messages to support right click context menu (#6748)

This commit is contained in:
Pranav Raj S
2023-03-24 13:49:44 -07:00
committed by GitHub
parent a6e7737c56
commit d666afd757
7 changed files with 78 additions and 61 deletions

View File

@@ -21,8 +21,8 @@ class MessageFinder
end
def current_messages
if @params[:after].present?
messages.reorder('created_at asc').where('id >= ?', @params[:before].to_i).limit(20)
if @params[:after].present? && @params[:before].present?
messages.reorder('created_at asc').where('id >= ? AND id < ?', @params[:after].to_i, @params[:before].to_i).limit(1000)
elsif @params[:before].present?
messages.reorder('created_at desc').where('id < ?', @params[:before].to_i).limit(20).reverse
else