mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Fix my prev_page code, thanks to riking
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
|
||||
<p>
|
||||
<% if @topic_view.posts.length > 0 && @topic_view.prev_page %>
|
||||
<% if @topic_view.prev_page %>
|
||||
<%= link_to t(:prev_page), @topic_view.prev_page_path, rel: 'prev' %>
|
||||
<% end %>
|
||||
<% if @topic_view.next_page %>
|
||||
|
@@ -60,7 +60,7 @@ class TopicView
|
||||
end
|
||||
|
||||
def prev_page
|
||||
if @page && @page > 1
|
||||
if @page && @page > 1 && posts.length > 0
|
||||
@page - 1
|
||||
else
|
||||
nil
|
||||
|
Reference in New Issue
Block a user